Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBuilder ¶
func NewBuilder(opts ...BuilderOption) *builder
Types ¶
type BuilderOption ¶
type BuilderOption struct {
// contains filtered or unexported fields
}
func WithDNSPollingInterval ¶
func WithDNSPollingInterval(d time.Duration) BuilderOption
func WithEtcdClient ¶
func WithEtcdClient(cli *clientv3.Client) BuilderOption
type EtcdSrvRecord ¶
type EtcdSrvRecord interface { // Register registers the record to etcd. // This method should be called when the service starts. Register() // Unregister unregisters the record from etcd. // This method should be called when the service is closed. Unregister(context.Context) error // CatchRuntimeErrors catches runtime errors. // Since the EtcdSrvRecord spawns goroutines to keep heartbeat // to etcd after calling Register, some errors may occur at runtime. CatchRuntimeErrors() <-chan error }
EtcdSrvRecord is a service record to be registered to or unregistered from etcd.
func NewEtcdSrvRecord ¶
func NewEtcdSrvRecord(cli *clientv3.Client, srvName, srvAddr string) (EtcdSrvRecord, error)
NewEtcdSrvRecord construct a service record.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.