From 9c17e64ef16405b052bc2f0cc509aa672c8f0667 Mon Sep 17 00:00:00 2001 From: Asim Date: Wed, 2 Dec 2015 21:16:44 +0000 Subject: [PATCH] add comments for wrappers --- server/server_wrapper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/server_wrapper.go b/server/server_wrapper.go index c014f0e5..c6c4303f 100644 --- a/server/server_wrapper.go +++ b/server/server_wrapper.go @@ -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