backend

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Clients = &BackendClients{Clients: make(map[string]*rpc.Client)}

Functions

func CallRpc

func CallRpc(method string, args, reply interface{}) error

func InitClients

func InitClients(addresses []string)

Types

type BackendClients

type BackendClients struct {
	sync.RWMutex
	Clients   map[string]*rpc.Client
	Addresses []string
}

func (*BackendClients) GetAddresses

func (this *BackendClients) GetAddresses() []string

func (*BackendClients) GetClient

func (this *BackendClients) GetClient(addr string) (*rpc.Client, bool)

func (*BackendClients) InitAddresses

func (this *BackendClients) InitAddresses(addresses []string)

func (*BackendClients) InitClients

func (this *BackendClients) InitClients(clients map[string]*rpc.Client)

func (*BackendClients) ReplaceClient

func (this *BackendClients) ReplaceClient(addr string, client *rpc.Client)

Jump to

Keyboard shortcuts

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