resolver

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EtcdScheme = "etcd"
View Source
const StaticScheme = "static"

Variables

This section is empty.

Functions

func RegisterEtcdSrvInstance

func RegisterEtcdSrvInstance(ctx context.Context, target, instanceId, address string, ttl int64) error

RegisterEtcdSrvInstance 注册服务器实例 用于注册自身作为服务器实例,以便于其他客户端可以动态感知, ttl (s) 租约续期时间 如果在指定时间未续约,etcd将取消注册,其他客户端将无法感知该实例

Types

type Etcd

type Etcd struct {
	EtcdUrls []string
}

func (Etcd) NewResolver

func (e Etcd) NewResolver() (gResolver.Builder, error)

type IResolver

type IResolver interface {
	NewResolver() (gResolver.Builder, error)
}

type Static

type Static struct {
	Addresses map[string][]string
}

func (Static) NewResolver

func (s Static) NewResolver() (gResolver.Builder, error)

type StaticResolver

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

func (*StaticResolver) Close

func (*StaticResolver) Close()

func (*StaticResolver) ResolveNow

type StaticResolverParam

type StaticResolverParam struct {
	Addresses map[string][]string
}

Jump to

Keyboard shortcuts

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