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

     1  package leader
     2  
     3  type Options struct {
     4  	Nodes []string
     5  	Group string
     6  }
     7  
     8  type ElectOptions struct{}
     9  
    10  // Nodes sets the addresses of the underlying systems
    11  func Nodes(a ...string) Option {
    12  	return func(o *Options) {
    13  		o.Nodes = a
    14  	}
    15  }
    16  
    17  // Group sets the group name for coordinating leadership
    18  func Group(g string) Option {
    19  	return func(o *Options) {
    20  		o.Group = g
    21  	}
    22  }