services

package
v0.0.0-...-dab49bf Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: BSD-3-Clause-LBNL Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMonitorChannel

func StartMonitorChannel(channel string, conn_id int)

func StopMonitorChannel

func StopMonitorChannel(channel string, conn_id int)

Types

type ApiDispatcher

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

ApiDispatcher ...

func NewApiDispatcher

func NewApiDispatcher(thread_number int) (*ApiDispatcher, error)

NewApiDispatcher ...

func (*ApiDispatcher) RegisterApi

func (ad *ApiDispatcher) RegisterApi(def ApiFactory) error

RegisterApi ...

func (*ApiDispatcher) SetBinaryAnswerHandler

func (ad *ApiDispatcher) SetBinaryAnswerHandler(callback func(id int, resutl *[]byte))

func (*ApiDispatcher) SetStringAnswerHandler

func (ad *ApiDispatcher) SetStringAnswerHandler(callback func(id int, resutl *string))

func (*ApiDispatcher) Stop

func (ad *ApiDispatcher) Stop()

Stop ...

func (*ApiDispatcher) SubmitRequest

func (ad *ApiDispatcher) SubmitRequest(req *RequestSubmission) error

ProcessBinaryRequest ...

type ApiFactory

type ApiFactory interface {
	Name() string
	BuildApiByString(result_channel chan<- *ApiResult, conn_id int, conf *string) interface{}
	BuildApiByBinary(result_channel chan<- *ApiResult, conn_id int, conf *[]byte) interface{}
}

ApiDefinition ...

type ApiResult

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

Api result

type ClusterConfig

type ClusterConfig struct {
	JoinList []string
	BindPort int
}

CLuster engine configuration

type DataType

type DataType int32
const (
	Binary DataType = iota
	String
)

type GetApi

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

GetApi

func (*GetApi) Run

func (ga *GetApi) Run()

type GetApiFactory

type GetApiFactory struct {
}

GetApi

func (GetApiFactory) BuildApiByBinary

func (gaf GetApiFactory) BuildApiByBinary(result_channel chan<- *ApiResult, conn_id int, conf *[]byte) interface{}

func (GetApiFactory) BuildApiByString

func (gaf GetApiFactory) BuildApiByString(result_channel chan<- *ApiResult, conn_id int, conf *string) interface{}

func (GetApiFactory) Name

func (gaf GetApiFactory) Name() string

type Message

type Message struct {
	Action string // add, del
	Data   map[string]string
}

Message cluster exange message

type Node

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

Node...

func (*Node) Start

func (n *Node) Start() error

type NodeClusterMetadata

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

NodeClusterMetadata

func Init

func Init(config *ClusterConfig) (*NodeClusterMetadata, error)

Init cluster engine

func (*NodeClusterMetadata) GetBroadcasts

func (n *NodeClusterMetadata) GetBroadcasts(overhead, limit int) [][]byte

func (*NodeClusterMetadata) GetJoinedNode

func (n *NodeClusterMetadata) GetJoinedNode() []string

GetJoinedNode return all joined node exclude current instance

func (*NodeClusterMetadata) LocalState

func (n *NodeClusterMetadata) LocalState(join bool) []byte

func (*NodeClusterMetadata) MergeRemoteState

func (n *NodeClusterMetadata) MergeRemoteState(buf []byte, join bool)

func (*NodeClusterMetadata) NodeMeta

func (n *NodeClusterMetadata) NodeMeta(limit int) []byte

func (*NodeClusterMetadata) NotifyJoin

func (n *NodeClusterMetadata) NotifyJoin(node *memberlist.Node)

func (*NodeClusterMetadata) NotifyLeave

func (n *NodeClusterMetadata) NotifyLeave(node *memberlist.Node)

func (*NodeClusterMetadata) NotifyMsg

func (n *NodeClusterMetadata) NotifyMsg(b []byte)

func (*NodeClusterMetadata) NotifyUpdate

func (n *NodeClusterMetadata) NotifyUpdate(node *memberlist.Node)

type RequestSubmission

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

RequestSubmission ...

type StartMonitorApi

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

GetApi

func (*StartMonitorApi) Run

func (sm *StartMonitorApi) Run()

type StartMonitorApiFactory

type StartMonitorApiFactory struct {
}

GetApi

func (StartMonitorApiFactory) BuildApiByBinary

func (smf StartMonitorApiFactory) BuildApiByBinary(result_channel chan<- *ApiResult, conn_id int, conf *[]byte) interface{}

func (StartMonitorApiFactory) BuildApiByString

func (smf StartMonitorApiFactory) BuildApiByString(result_channel chan<- *ApiResult, conn_id int, conf *string) interface{}

func (StartMonitorApiFactory) Name

func (smf StartMonitorApiFactory) Name() string

type StopMonitorApi

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

GetApi

func (*StopMonitorApi) Run

func (sm *StopMonitorApi) Run()

type StopMonitorApiFactory

type StopMonitorApiFactory struct {
}

GetApi

func (StopMonitorApiFactory) BuildApiByBinary

func (smf StopMonitorApiFactory) BuildApiByBinary(result_channel chan<- *ApiResult, conn_id int, conf *[]byte) interface{}

func (StopMonitorApiFactory) BuildApiByString

func (smf StopMonitorApiFactory) BuildApiByString(result_channel chan<- *ApiResult, conn_id int, conf *string) interface{}

func (StopMonitorApiFactory) Name

func (smf StopMonitorApiFactory) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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