Skip to content

Commit

Permalink
Merge pull request #158 from unistack-org/meter
Browse files Browse the repository at this point in the history
meter/wrapper: fix naming
  • Loading branch information
vtolstov authored Nov 28, 2022
2 parents 2fb1085 + d23de14 commit 25a796f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions meter/wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,22 @@ func (w *wrapper) Publish(ctx context.Context, p client.Message, opts ...client.
}

// NewHandlerWrapper create new server handler wrapper
// deprecated
func NewHandlerWrapper(opts ...Option) server.HandlerWrapper {
handler := &wrapper{
opts: NewOptions(opts...),
}
return handler.HandlerFunc
}

// NewServerHandlerWrapper create new server handler wrapper
func NewServerHandlerWrapper(opts ...Option) server.HandlerWrapper {
handler := &wrapper{
opts: NewOptions(opts...),
}
return handler.HandlerFunc
}

func (w *wrapper) HandlerFunc(fn server.HandlerFunc) server.HandlerFunc {
return func(ctx context.Context, req server.Request, rsp interface{}) error {
endpoint := req.Service() + "." + req.Endpoint()
Expand Down Expand Up @@ -295,13 +304,21 @@ func (w *wrapper) HandlerFunc(fn server.HandlerFunc) server.HandlerFunc {
}

// NewSubscriberWrapper create server subscribe wrapper
// deprecated
func NewSubscriberWrapper(opts ...Option) server.SubscriberWrapper {
handler := &wrapper{
opts: NewOptions(opts...),
}
return handler.SubscriberFunc
}

func NewServerSubscriberWrapper(opts ...Option) server.SubscriberWrapper {
handler := &wrapper{
opts: NewOptions(opts...),
}
return handler.SubscriberFunc
}

func (w *wrapper) SubscriberFunc(fn server.SubscriberFunc) server.SubscriberFunc {
return func(ctx context.Context, msg server.Message) error {
endpoint := msg.Topic()
Expand Down

0 comments on commit 25a796f

Please sign in to comment.