github.com/volts-dev/volts@v0.0.0-20240120094013-5e9c65924106/registry/nop.go (about)

     1  package registry
     2  
     3  type (
     4  	// NopRegistry
     5  	nopRegistry struct {
     6  		config *Config
     7  	}
     8  )
     9  
    10  func newNopRegistry() *nopRegistry {
    11  	reg := &nopRegistry{
    12  		//	config: NewConfig(
    13  		//		WithName(""),
    14  		//	),
    15  		config: &Config{},
    16  	}
    17  	return reg
    18  }
    19  
    20  func (self *nopRegistry) Init(opts ...Option) error {
    21  	//self.config.Init(opts...)
    22  	return nil
    23  }
    24  
    25  func (self *nopRegistry) Config() *Config {
    26  	return self.config
    27  }
    28  
    29  // 注册
    30  func (*nopRegistry) Register(*Service, ...Option) error {
    31  	return nil
    32  }
    33  
    34  // 注销
    35  func (*nopRegistry) Deregister(*Service, ...Option) error {
    36  	return nil
    37  }
    38  
    39  func (*nopRegistry) GetService(string) ([]*Service, error) {
    40  	return nil, nil
    41  }
    42  
    43  func (*nopRegistry) ListServices() ([]*Service, error) {
    44  	return nil, nil
    45  }
    46  
    47  func (*nopRegistry) Watcher(...WatchOptions) (Watcher, error) {
    48  	return nil, nil
    49  }
    50  
    51  func (*nopRegistry) LocalServices() []*Service {
    52  	return nil
    53  }
    54  
    55  func (self *nopRegistry) String() string {
    56  	return "" // self.config.Name
    57  }