|
@@ -16,41 +16,36 @@ type (
|
|
|
Server Server
|
|
|
Context context.Context
|
|
|
}
|
|
|
- OptionMiddleware func(o *Options)
|
|
|
+
|
|
|
+ Option func(o *Options)
|
|
|
)
|
|
|
|
|
|
-func WithName(name string, version string) OptionMiddleware {
|
|
|
+func WithName(name string, version string) Option {
|
|
|
return func(o *Options) {
|
|
|
o.Name = name
|
|
|
o.Version = version
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithRegistry(r registry.Registry) OptionMiddleware {
|
|
|
+func WithRegistry(r registry.Registry) Option {
|
|
|
return func(o *Options) {
|
|
|
o.registry = r
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithContext(c context.Context) OptionMiddleware {
|
|
|
- return func(o *Options) {
|
|
|
- o.Context = c
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithServer(s Server) OptionMiddleware {
|
|
|
+func WithServer(s Server) Option {
|
|
|
return func(o *Options) {
|
|
|
o.Server = s
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithoutHttp() OptionMiddleware {
|
|
|
+func WithoutHttp() Option {
|
|
|
return func(o *Options) {
|
|
|
o.EnableHttp = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithoutRPC() OptionMiddleware {
|
|
|
+func WithoutRPC() Option {
|
|
|
return func(o *Options) {
|
|
|
o.EnableRPC = false
|
|
|
}
|