noop impl (#32)
* improve logger usage * add noop client and server Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -9,6 +9,10 @@ type HandlerOptions struct {
|
||||
Metadata map[string]map[string]string
|
||||
}
|
||||
|
||||
func NewHandlerOptions() HandlerOptions {
|
||||
return HandlerOptions{}
|
||||
}
|
||||
|
||||
type SubscriberOption func(*SubscriberOptions)
|
||||
|
||||
type SubscriberOptions struct {
|
||||
@@ -20,6 +24,19 @@ type SubscriberOptions struct {
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
func NewSubscriberOptions(opts ...SubscriberOption) SubscriberOptions {
|
||||
opt := SubscriberOptions{
|
||||
AutoAck: true,
|
||||
Context: context.Background(),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&opt)
|
||||
}
|
||||
|
||||
return opt
|
||||
}
|
||||
|
||||
// EndpointMetadata is a Handler option that allows metadata to be added to
|
||||
// individual endpoints.
|
||||
func EndpointMetadata(name string, md map[string]string) HandlerOption {
|
||||
@@ -44,18 +61,6 @@ func InternalSubscriber(b bool) SubscriberOption {
|
||||
o.Internal = b
|
||||
}
|
||||
}
|
||||
func NewSubscriberOptions(opts ...SubscriberOption) SubscriberOptions {
|
||||
opt := SubscriberOptions{
|
||||
AutoAck: true,
|
||||
Context: context.Background(),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&opt)
|
||||
}
|
||||
|
||||
return opt
|
||||
}
|
||||
|
||||
// DisableAutoAck will disable auto acking of messages
|
||||
// after they have been handled.
|
||||
|
Reference in New Issue
Block a user