xplane

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppStatus

type AppStatus struct {
	ClusterName string                `json:"cluster_name,omitempty"`
	Nodes       map[string][]NodeStat `json:"nodes,omitempty"`
}

type ControlPlane

type ControlPlane interface {
	Start() error
	//	Inject(iapp any, config *config.AppConfig) error
	SetJobChan(chan *job.Job)
	NotifyStat(stats NodeStat) error

	GetAppStatus() (*AppStatus, error)
	GetLocker() Locker
	GetRouter() Router

	GetSockdRouter() SockdRouter

	GetMsgBus() MsgBus

	GetNodeId() int64
	GetIdService() IDService
}

type IDService

type IDService interface {
	DeviceNode() *snowflake.Node
	SessionNode() *snowflake.Node
	EventNode() *snowflake.Node
	RequestNode() *snowflake.Node
	DisplayErrNode() *snowflake.Node

	NewNode(key string) *snowflake.Node
}

type Locker

type Locker interface{}

type Message

type Message struct {
	Id      int64
	Topic   string
	Tenant  string
	Path    string
	Data    string
	Persist bool
}

type MsgBus

type MsgBus interface {
	Start() error
	Stop() error

	Subscribe(topic string, ch chan Message) (int32, error)
	UnSubscribe(topic string, subid int32) error
	Submit(topic string, msg Message) (int64, error)
}

type NodeStat

type NodeStat struct {
	Epoch     int `json:"epoch,omitempty"`
	TotalMem  int `json:"total_mem,omitempty"`
	UsedMem   int `json:"used_mem,omitempty"`
	TotalSwap int `json:"total_swap,omitempty"`
	UsedSwap  int `json:"used_swap,omitempty"`
	CPU       int `json:"cpu,omitempty"`
	AvgLoad   int `json:"avg_load,omitempty"`
}

type NodeStatus

type NodeStatus struct {
	Id         string     `json:"id,omitempty"`
	Stats      []NodeStat `json:"stats,omitempty"`
	LastUpdate string     `json:"last_update,omitempty"`
	Tags       []string   `json:"tags,omitempty"`
}

type Router

type Router interface {
	Route(j *job.Job) bool
}

type SockdRouter

type SockdRouter interface {
	Publish(tenantId, room string, tags map[string]string, rawData []byte) error
	Broadcast(tenantId, room string, rawData []byte) error
	SendSession(tenantId, session string, rawData []byte) error
}

type StateWatcher

type StateWatcher interface {
	ApplyTargetHook(tenantId string, id int64, data *entities.TargetHook)
}

type Subscription

type Subscription struct {
	Id   int32
	Chan chan<- Message
}

Jump to

Keyboard shortcuts

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