Skip to content

Commit

Permalink
add comments for wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
Asim committed Dec 2, 2015
1 parent 5e36469 commit 9c17e64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/server_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ import (
"golang.org/x/net/context"
)

// HandlerFunc represents a single method of a handler. It's used primarily
// for the wrappers. What's handed to the actual method is the concrete
// request and response types.
type HandlerFunc func(ctx context.Context, req Request, rsp interface{}) error

// SubscriberFunc represents a single method of a subscriber. It's used primarily
// for the wrappers. What's handed to the actual method is the concrete
// publication message.
type SubscriberFunc func(ctx context.Context, msg Publication) error

// HandlerWrapper wraps the HandlerFunc and returns the equivalent
type HandlerWrapper func(HandlerFunc) HandlerFunc

// SubscriberWrapper wraps the SubscriberFunc and returns the equivalent
type SubscriberWrapper func(SubscriberFunc) SubscriberFunc

0 comments on commit 9c17e64

Please sign in to comment.