micro/util/http/options.go

19 lines
305 B
Go
Raw Normal View History

2019-05-30 23:52:10 +01:00
package http
import "github.com/unistack-org/micro/v3/router"
2019-05-30 23:52:10 +01:00
// Options struct
2019-05-30 23:52:10 +01:00
type Options struct {
Router router.Router
2019-05-30 23:52:10 +01:00
}
// Option func
2019-05-30 23:52:10 +01:00
type Option func(*Options)
// WithRouter sets the router.Router option
func WithRouter(r router.Router) Option {
2019-05-30 23:52:10 +01:00
return func(o *Options) {
o.Router = r
2019-05-30 23:52:10 +01:00
}
}