etcd

package
v1.1.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const RegisterPrefix = "/srv/reg"
View Source
const TIME_LAYOUT = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdV3Wrapper

type EtcdV3Wrapper struct {
	// contains filtered or unexported fields
}

func NewEtcdV3Wrapper

func NewEtcdV3Wrapper(endpoints string, dialTimeout int64, timeout int64) (*EtcdV3Wrapper, error)

type ServiceDiscovery

type ServiceDiscovery struct {
	*EtcdV3Wrapper
	// contains filtered or unexported fields
}

func NewServiceDiscovery

func NewServiceDiscovery(endpoints string, dialTimeout int64) (*ServiceDiscovery, error)

func (*ServiceDiscovery) Build

func (*ServiceDiscovery) Close

func (sdv *ServiceDiscovery) Close()

Close closes the resolver.

func (*ServiceDiscovery) ResolveNow

func (sdv *ServiceDiscovery) ResolveNow(options resolver.ResolveNowOptions)

func (*ServiceDiscovery) Scheme

func (sdv *ServiceDiscovery) Scheme() string

type ServiceRegister

type ServiceRegister struct {
	*EtcdV3Wrapper
	// contains filtered or unexported fields
}

func RegisterService

func RegisterService(endpoints string, srName string, srConnect string, leaseTime int64) *ServiceRegister

func (*ServiceRegister) Close

func (srr *ServiceRegister) Close()

func (*ServiceRegister) ListenLease

func (srr *ServiceRegister) ListenLease()

type ServiceRegisterInfo

type ServiceRegisterInfo struct {
	SrName           string `json:"sr_name"`
	SrInvoke         string `json:"sr_invoke"`
	CreateTime       int64  `json:"create_time"`
	CreateTimeFormat string `json:"create_time_format"`
	LeaseTime        int64  `json:"lease_time"`
	HostName         string `json:"hostname"`
}

func NewRegisterInfo

func NewRegisterInfo() *ServiceRegisterInfo

func (*ServiceRegisterInfo) Parse

func (r *ServiceRegisterInfo) Parse(s string) error

func (*ServiceRegisterInfo) String

func (r *ServiceRegisterInfo) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL