Skip to content

Commit

Permalink
feat: allow to set API listen address
Browse files Browse the repository at this point in the history
  • Loading branch information
morya committed Dec 15, 2023
1 parent cbd45b1 commit b1ba620
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ func NewOptions(opts ...Option) 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.
func WithRouter(r router.Router) Option {
return func(o *Options) error {
Expand All @@ -35,3 +43,4 @@ func WithRegistry(r registry.Registry) Option {
return nil
}
}

0 comments on commit b1ba620

Please sign in to comment.