etcd

package
v0.0.0-...-379bff8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg conf.EtcdConfig) error

func NewResolver

func NewResolver(client *Client, scheme string) re.Builder

func RegisterMethod

func RegisterMethod(client *Client, version, service, method string, auth bool) error

func UnRegisterMethod

func UnRegisterMethod(client *Client, version, service, method string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
var (
	Cli      *Client
	Resolver re.Builder
)

func (*Client) Cli

func (cl *Client) Cli() *v3.Client

func (*Client) Close

func (cl *Client) Close() error

func (*Client) GetPattern

func (cl *Client) GetPattern(key string) (result map[string]string)

func (*Client) GetSingle

func (cl *Client) GetSingle(key string) string

func (*Client) Kv

func (cl *Client) Kv() v3.KV

func (*Client) RegisterApi

func (cl *Client) RegisterApi(name string, data interface{}, config conf.YamlConfig) error

func (*Client) RegisterService

func (cl *Client) RegisterService(name, addr string, ttl int64) error

func (*Client) Set

func (cl *Client) Set(key, value string) bool

func (*Client) UnRegister

func (cl *Client) UnRegister(name, addr string) error

func (*Client) UnRegisterApi

func (cl *Client) UnRegisterApi(name string, data interface{}, config conf.YamlConfig) error

type Method

type Method struct {
	Authorization bool   `json:"authorization"` // 是否需要登录
	Path          string `json:"path"`
}

func (*Method) Marshal

func (m *Method) Marshal() string

Jump to

Keyboard shortcuts

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