gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/api/resolver/options.go (about)

     1  package resolver
     2  
     3  // NewOptions returns new initialised options
     4  func NewOptions(opts ...Option) Options {
     5  	var options Options
     6  	for _, o := range opts {
     7  		o(&options)
     8  	}
     9  	return options
    10  }
    11  
    12  // WithHandler sets the handler being used
    13  func WithHandler(h string) Option {
    14  	return func(o *Options) {
    15  		o.Handler = h
    16  	}
    17  }
    18  
    19  // WithNamespace sets the namespace being used
    20  func WithNamespace(n string) Option {
    21  	return func(o *Options) {
    22  		o.Namespace = n
    23  	}
    24  }