Update the way flags are used
This commit is contained in:
@@ -105,12 +105,13 @@ func (s *rpcServer) Options() Options {
|
||||
return opts
|
||||
}
|
||||
|
||||
func (s *rpcServer) Init(opts ...Option) {
|
||||
func (s *rpcServer) Init(opts ...Option) error {
|
||||
s.Lock()
|
||||
for _, opt := range opts {
|
||||
opt(&s.opts)
|
||||
}
|
||||
s.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *rpcServer) NewHandler(h interface{}) Handler {
|
||||
|
||||
@@ -40,7 +40,7 @@ import (
|
||||
|
||||
type Server interface {
|
||||
Options() Options
|
||||
Init(...Option)
|
||||
Init(...Option) error
|
||||
Handle(Handler) error
|
||||
NewHandler(interface{}) Handler
|
||||
NewSubscriber(string, interface{}) Subscriber
|
||||
|
||||
Reference in New Issue
Block a user