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 (sdv *ServiceDiscovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
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
Click to show internal directories.
Click to hide internal directories.