grpcclient

package
v0.0.0-...-3c905e5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 16 Imported by: 5

Documentation

Index

Constants

View Source
const (
	UNKNOWN = 0
	NOTSYNC = 1
	SYNC    = 2
)

节点同步状态

View Source
const SyncLbName = "sync"

SyncLbName is the name of sync balancer.

Variables

This section is empty.

Functions

func GetDefaultMainClient

func GetDefaultMainClient() types.ChainClient

GetDefaultMainClient get default client

func NewMainChainClient

func NewMainChainClient(cfg *types.ChainConfig, grpcaddr string) (types.ChainClient, error)

NewMainChainClient 创建一个平行链的 主链 grpc chain 客户端

func NewMultipleURL

func NewMultipleURL(url string) string

NewMultipleURL 创建url

func NewSyncURL

func NewSyncURL(url string) string

NewSyncURL 创建url

func SetAddrInfo

func SetAddrInfo(addr resolver.Address, addrInfo AddrInfo) resolver.Address

SetAddrInfo returns a copy of addr in which the Attributes field is updated with addrInfo.

Types

type AddrInfo

type AddrInfo struct {
	State int
}

AddrInfo will be stored inside Address metadata in order to use weighted balancer.

func GetAddrInfo

func GetAddrInfo(addr resolver.Address) AddrInfo

GetAddrInfo returns the AddrInfo stored in the Attributes fields of addr.

Jump to

Keyboard shortcuts

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