Documentation ¶
Index ¶
- Constants
- type DiscoveryService
- type EtcdDiscovery
- func (d *EtcdDiscovery) AddShutdownHook(serviceName string, endpoint ServiceEndpoint)
- func (d *EtcdDiscovery) Delete(serviceName string, endpoint ServiceEndpoint) error
- func (d *EtcdDiscovery) GetService(serviceName string) *Service
- func (d *EtcdDiscovery) RegisterService(serviceName string, endpoint ServiceEndpoint) error
- func (d *EtcdDiscovery) Update(service *Service) error
- type Service
- type ServiceEndpoint
Constants ¶
View Source
const SERVICE_DIR = "/pub/pjoc/pay/services"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryService ¶
type DiscoveryService interface { RegisterService(serviceName string, endpoint ServiceEndpoint) error GetService(serviceName string) *Service }
func InitEtcdDiscoveryService ¶
func InitEtcdDiscoveryService(etcd *etcdv3.EtcdConfig, serviceDir string) DiscoveryService
type EtcdDiscovery ¶
type EtcdDiscovery struct { ServiceDir string // contains filtered or unexported fields }
func (*EtcdDiscovery) AddShutdownHook ¶
func (d *EtcdDiscovery) AddShutdownHook(serviceName string, endpoint ServiceEndpoint)
func (*EtcdDiscovery) Delete ¶
func (d *EtcdDiscovery) Delete(serviceName string, endpoint ServiceEndpoint) error
func (*EtcdDiscovery) GetService ¶
func (d *EtcdDiscovery) GetService(serviceName string) *Service
func (*EtcdDiscovery) RegisterService ¶
func (d *EtcdDiscovery) RegisterService(serviceName string, endpoint ServiceEndpoint) error
func (*EtcdDiscovery) Update ¶
func (d *EtcdDiscovery) Update(service *Service) error
type Service ¶
type Service struct { ServiceName string `json:"service_name"` Endpoints []ServiceEndpoint `json:"endpoints"` sync.Mutex }
type ServiceEndpoint ¶
Click to show internal directories.
Click to hide internal directories.