We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 517b2b0 commit 156a968Copy full SHA for 156a968
micro.go
@@ -20,6 +20,8 @@ type Service interface {
20
Init(...Option)
21
// Options returns the current options
22
Options() Options
23
+ // Register the handler
24
+ Handle(v interface{}) error
25
// Client is used to call services
26
Client() client.Client
27
// Server is for handling requests and events
service.go
@@ -126,6 +126,12 @@ func (s *service) Stop() error {
126
return err
127
}
128
129
+func (s *service) Handle(v interface{}) error {
130
+ return s.opts.Server.Handle(
131
+ s.opts.Server.NewHandler(h),
132
+ )
133
+}
134
+
135
func (s *service) Run() (err error) {
136
logger := s.opts.Logger
137
0 commit comments