Documentation ¶
Overview ¶
etcd @author LanguageY++2013 2023/5/8 18:31 @company soulgame
etcd @author LanguageY++2013 2023/5/8 22:08 @company soulgame
etcd @author LanguageY++2013 2023/5/8 23:49 @company soulgame
Index ¶
Constants ¶
View Source
const (
EtcdScheme = "etcd2"
)
View Source
const GrpcServicePrefix = "services.grpc"
Variables ¶
View Source
var (
TimeToLive = timeToLive
)
Functions ¶
func BuildTarget ¶
返回一个代表所给endpoints的字符串,keyPrefix代码服务前缀
Types ¶
type ServiceDescriptor ¶
type ServiceDescriptor struct { Name string // 服务名 ListenAddr string // 服务地址 Tags []string // 标签信息, 例如版本 }
func (*ServiceDescriptor) Key ¶
func (sd *ServiceDescriptor) Key() string
func (*ServiceDescriptor) Value ¶
func (sd *ServiceDescriptor) Value() string
type ServicePublisher ¶
type ServicePublisher struct {
// contains filtered or unexported fields
}
func NewServicePublisher ¶
func NewServicePublisher(ctx context.Context, client *clientv3.Client) (p *ServicePublisher, err error)
NewServicePublisher 新建服务发布
func (*ServicePublisher) KeepAlive ¶
func (p *ServicePublisher) KeepAlive() (err error)
KeepAlive 授权
func (*ServicePublisher) KeepAliveAsync ¶
func (p *ServicePublisher) KeepAliveAsync() (err error)
func (*ServicePublisher) Publish ¶
func (p *ServicePublisher) Publish(sd *ServiceDescriptor) (err error)
Click to show internal directories.
Click to hide internal directories.