mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-18 08:26:38 +02:00
feat: allow to set API listen address (#2680)
This commit is contained in:
parent
3a4790b3c5
commit
f28468a59c
@ -19,6 +19,14 @@ func NewOptions(opts ...Option) Options {
|
|||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithAddress sets the address to listen
|
||||||
|
func WithAddress(addr string) Option {
|
||||||
|
return func(o *Options) error {
|
||||||
|
o.Address = addr
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WithRouter sets the router to use e.g static or registry.
|
// WithRouter sets the router to use e.g static or registry.
|
||||||
func WithRouter(r router.Router) Option {
|
func WithRouter(r router.Router) Option {
|
||||||
return func(o *Options) error {
|
return func(o *Options) error {
|
||||||
@ -35,3 +43,4 @@ func WithRegistry(r registry.Registry) Option {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user