etcd

package
v0.0.0-...-237b7d6 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 13 Imported by: 0

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

func BuildTarget(endpoints []string, service string) string

返回一个代表所给endpoints的字符串,keyPrefix代码服务前缀

func BuildTargetWithUserPassword

func BuildTargetWithUserPassword(endpoints []string, service string, username, password string) string

返回一个代表所给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)

func (*ServicePublisher) Stop

func (p *ServicePublisher) Stop()

Stop 停止

Jump to

Keyboard shortcuts

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