Documentation ¶
Index ¶
- func NewProfileHttpServer(addr string)
- func ProgramHandler(LinkName string, obj *bpf.BpfObjects, debug bool, mode int) (*xdp.Program, *xdp.Socket)
- type MyPacket
- type NodeList
- func (nodeList *NodeList) Get() []common.Node
- func (nl *NodeList) GetMetadataHandler() http.HandlerFunc
- func (nodeList *NodeList) Join()
- func (nl *NodeList) ListNodeHandler() http.HandlerFunc
- func (nodeList *NodeList) New(localNode common.Node)
- func (nodeList *NodeList) Publish(newMetadata []byte)
- func (nl *NodeList) PublishHandler() http.HandlerFunc
- func (nodeList *NodeList) Read() []byte
- func (nodeList *NodeList) Set(node common.Node)
- func (nl *NodeList) SetNodeHandler() http.HandlerFunc
- func (nodeList *NodeList) Start()
- func (nodeList *NodeList) Stop()
- func (nl *NodeList) StopNodeHandler() http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProfileHttpServer ¶
func NewProfileHttpServer(addr string)
Types ¶
type NodeList ¶
type NodeList struct { Amount int // Number of nodes to send synchronization information to at one time Cycle int64 // Synchronization cycle (how many seconds to send list synchronization information to other nodes) Buffer int // UDP/TCP receive buffer size (determines how many requests the UDP/TCP listening service can process asynchronously) Size int // Maximum capacity of a single UDP/TCP heartbeat packet (in bytes) Timeout int64 // Expiry deletion limit for a single node (delete after how many seconds) SecretKey string // Cluster key, the keys of all nodes in the same cluster should be consistent Protocol string // Network protocol used by the cluster connection, UDP or TCP, XDP(UDP based with ebpf feature) default is UDP ListenAddr string // Local UDP/TCP listening address, use this address to receive heartbeat packets from other nodes (usually 0.0.0.0 is sufficient) IsPrint bool // Whether to print list synchronization information to the console Program *bpf.BpfObjects // bpf program Xsk *xdp.Socket // xdp socket Counter *common.AtomicCounter // bpf program key counter GatewayMAC string // gateway mac address // contains filtered or unexported fields }
NodeList is a list of nodes
func (*NodeList) GetMetadataHandler ¶
func (nl *NodeList) GetMetadataHandler() http.HandlerFunc
Get metadata.
func (*NodeList) ListNodeHandler ¶
func (nl *NodeList) ListNodeHandler() http.HandlerFunc
Dump node list.
func (*NodeList) PublishHandler ¶
func (nl *NodeList) PublishHandler() http.HandlerFunc
Publish data to all nodes.
func (*NodeList) SetNodeHandler ¶
func (nl *NodeList) SetNodeHandler() http.HandlerFunc
Set new node
func (*NodeList) Start ¶
func (nodeList *NodeList) Start()
Start restarts the broadcasting of heartbeat
func (*NodeList) StopNodeHandler ¶
func (nl *NodeList) StopNodeHandler() http.HandlerFunc
Stop a node.
Click to show internal directories.
Click to hide internal directories.