register

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoints

type Endpoints struct {
	Online         bool   `json:"online"`
	LimitingSwitch bool   `json:"limiting_switch"` //每秒多少次
	Limiting       int64  `json:"limiting"`        //每秒多少次
	Fuse           bool   `json:"fuse"`            //熔断
	Defaults       []byte `json:"defaults"`        //熔断默认值
}

type Node

type Node struct {
	Name    string `json:"name"`
	Path    string `json:"path"`
	Id      string `json:"id"`
	Version string `json:"version"`
	Address string `json:"address"`
}

type Options

type Options struct {
	EtcdConf    clientv3.Config      `json:"-"`
	RegisterTtl int64                `json:"-"`
	Node        *Node                `json:"node"`
	Metadata    map[string]string    `json:"metadata"`
	Endpoints   map[string]Endpoints `json:"endpoints"`
}

type Register

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

func NewRegister

func NewRegister(opt ...RegisterOptions) (*Register, error)

func (*Register) Close

func (s *Register) Close() error

Close 注销服务

func (*Register) ListenKeepAliveChan

func (s *Register) ListenKeepAliveChan() (isClose bool)

type RegisterOptions

type RegisterOptions func(*Options)

func SetAddress

func SetAddress(address string) RegisterOptions

func SetEtcdConf

func SetEtcdConf(conf clientv3.Config) RegisterOptions

func SetMetadata

func SetMetadata(metadata map[string]string) RegisterOptions

func SetName

func SetName(name string) RegisterOptions

func SetRegisterTtl

func SetRegisterTtl(registerTtl int64) RegisterOptions

func SetSrv

func SetSrv(srv interface{}) RegisterOptions

func SetVersion

func SetVersion(version string) RegisterOptions

Jump to

Keyboard shortcuts

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