cluster

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(port int, myIP string) *memberlist.Config

func DecodeNotifyMsg added in v1.4.0

func DecodeNotifyMsg[T any](msg *NotifyMsg) (*T, error)

func SendBroadcastQueue added in v1.4.0

func SendBroadcastQueue[T any](msg *T)

Types

type AuthMessage added in v1.4.0

type AuthMessage struct {
	NotifyMsg
	SessionID string `json:"session_id"`
	Token     string `json:"token"`
}

type Memberlist

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

func SetUp

func SetUp(port int, myIP string, notifyMsgFn NotifyMsgFn) (*Memberlist, error)

func (*Memberlist) ActiveNodes

func (m *Memberlist) ActiveNodes() []*memberlist.Node

func (*Memberlist) ActiveNodesWithoutSelf

func (m *Memberlist) ActiveNodesWithoutSelf() []*memberlist.Node

func (*Memberlist) MyNodeName

func (m *Memberlist) MyNodeName() string

func (*Memberlist) Start

func (m *Memberlist) Start(ctx context.Context, peerDomain string, tickTime time.Duration)

type NotifyMsg added in v1.4.0

type NotifyMsg struct {
	MsgType NotifyMsgType   `json:"msg_type"`
	Raw     json.RawMessage `json:"-"`
}

func (*NotifyMsg) UnmarshalJSON added in v1.4.0

func (m *NotifyMsg) UnmarshalJSON(data []byte) error

type NotifyMsgFn added in v1.4.0

type NotifyMsgFn func(msg *NotifyMsg)

type NotifyMsgType added in v1.4.0

type NotifyMsgType string
const (
	NotifyMsgType_AuthMessage NotifyMsgType = "auth_message"
)

Jump to

Keyboard shortcuts

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