2019-05-30 23:52:10 +01:00
|
|
|
package http
|
|
|
|
|
2020-08-19 17:47:17 +03:00
|
|
|
import "github.com/unistack-org/micro/v3/router"
|
2019-05-30 23:52:10 +01:00
|
|
|
|
2020-11-03 01:08:23 +03:00
|
|
|
// Options struct
|
2019-05-30 23:52:10 +01:00
|
|
|
type Options struct {
|
2020-07-01 17:06:59 +01:00
|
|
|
Router router.Router
|
2019-05-30 23:52:10 +01:00
|
|
|
}
|
|
|
|
|
2020-11-03 01:08:23 +03:00
|
|
|
// Option func
|
2019-05-30 23:52:10 +01:00
|
|
|
type Option func(*Options)
|
|
|
|
|
2020-11-03 01:08:23 +03:00
|
|
|
// WithRouter sets the router.Router option
|
2020-07-01 17:06:59 +01:00
|
|
|
func WithRouter(r router.Router) Option {
|
2019-05-30 23:52:10 +01:00
|
|
|
return func(o *Options) {
|
2020-07-01 17:06:59 +01:00
|
|
|
o.Router = r
|
2019-05-30 23:52:10 +01:00
|
|
|
}
|
|
|
|
}
|