cluster

package
v0.0.0-...-a538cea Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRpcClient

func GetRpcClient(nodeId int, serviceMethod string, clientList *[]*rpc.Client) error

func GetRpcServer

func GetRpcServer() *rpc.Server

func SetConfigDir

func SetConfigDir(cfgdir string)

Types

type Cluster

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

func GetCluster

func GetCluster() *Cluster

func (*Cluster) FindRpcHandler

func (slf *Cluster) FindRpcHandler(servicename string) rpc.IRpcHandler

func (*Cluster) GetNodeIdByService

func (slf *Cluster) GetNodeIdByService(servicename string, rpcClientList *[]*rpc.Client)

func (*Cluster) GetRpcClient

func (slf *Cluster) GetRpcClient(nodeid int) *rpc.Client

func (*Cluster) GetServiceCfg

func (slf *Cluster) GetServiceCfg(nodeid int, servicename string) interface{}

func (*Cluster) Init

func (slf *Cluster) Init(currentNodeId int) error

func (*Cluster) InitCfg

func (slf *Cluster) InitCfg(currentNodeId int) error

func (*Cluster) IsConfigService

func (slf *Cluster) IsConfigService(servicename string) bool

func (*Cluster) IsNodeConnected

func (slf *Cluster) IsNodeConnected(nodeId int) bool

func (*Cluster) ReadAllSubNetConfig

func (slf *Cluster) ReadAllSubNetConfig() error

func (*Cluster) ReadClusterConfig

func (slf *Cluster) ReadClusterConfig(filepath string) (*SubNet, error)

func (*Cluster) ReadLocalSubNetServiceConfig

func (slf *Cluster) ReadLocalSubNetServiceConfig(subnet string) error

func (*Cluster) ReadServiceConfig

func (slf *Cluster) ReadServiceConfig(filepath string) (map[string]interface{}, map[int]map[string]interface{}, error)

func (*Cluster) Start

func (slf *Cluster) Start()

type NodeInfo

type NodeInfo struct {
	NodeId      int
	ListenAddr  string
	NodeName    string
	ServiceList []string
}

type NodeRpcInfo

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

type SubNet

type SubNet struct {
	SubNetName string
	NodeList   []NodeInfo
}

Jump to

Keyboard shortcuts

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