etcdcenter

package module
v0.0.0-...-0b87bc5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

grin-etcd-center

etcd center

Documentation

Index

Constants

View Source
const (
	DefaultTTl int64 = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdBuilder

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

func (*EtcdBuilder) Build

func (*EtcdBuilder) Scheme

func (s *EtcdBuilder) Scheme() string

type EtcdCenter

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

func (*EtcdCenter) Builder

func (c *EtcdCenter) Builder() resolver.Builder

func (*EtcdCenter) Registrar

func (c *EtcdCenter) Registrar(serverName, host string, port int, opts ...Option) Registrar

type EtcdRegistrar

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

func (*EtcdRegistrar) Deregistry

func (s *EtcdRegistrar) Deregistry() error

func (*EtcdRegistrar) Registry

func (s *EtcdRegistrar) Registry() error

type IEtcdCenter

type IEtcdCenter interface {
	Registrar(serverName, host string, port int, opts ...Option) Registrar
	Builder() resolver.Builder
}

func NewEtcdCenter

func NewEtcdCenter(endpoints []string, timeout int) (IEtcdCenter, error)

type Option

type Option func(*opt)

func WithLogger

func WithLogger(fn func(error)) Option

func WithTTL

func WithTTL(ttl int64) Option

type Registrar

type Registrar interface {
	// 注册服务到注册中心
	Registry() error
	// 从注册中心注销服务
	Deregistry() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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