cluster

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LEAF_PING_INTERVAL = 2 * time.Second
	RECONNECT_DELAY    = 5 * time.Second
)
View Source
const (
	GroupFullSyncMsg gossip.MessageType = iota + gossip.UserMsg
	GroupGossipMsg
	RoleFullSyncMsg
	RoleGossipMsg
	SpaceFullSyncMsg
	SpaceGossipMsg
	TemplateFullSyncMsg
	TemplateGossipMsg
	TemplateVarFullSyncMsg
	TemplateVarGossipMsg
	UserFullSyncMsg
	UserGossipMsg
	TokenFullSyncMsg
	TokenGossipMsg
	SessionFullSyncMsg
	SessionGossipMsg
	VolumeFullSyncMsg
	VolumeGossipMsg
	AuditLogGossipMsg
	ResourceLockFullSyncMsg
	ResourceLockGossipMsg
	ResourceLockMsg
	ResourceUnlockMsg
)
View Source
const (
	ResourceLockTTL        = 1 * time.Minute
	ResourceLockGCInterval = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func NewCluster

func NewCluster(
	clusterKey string,
	advertiseAddr string,
	bindAddr string,
	routes *http.ServeMux,
	compress bool,
	allowLeaf bool,
) *Cluster

func (*Cluster) CalcLeafPayloadSize

func (c *Cluster) CalcLeafPayloadSize(totalNodes int) int

This is a duplicate of the gossip payload size calculation, however when gossip isn't running we still need this for sending to leaf nodes

func (*Cluster) DoGroupFullSync

func (c *Cluster) DoGroupFullSync(node *gossip.Node) error

func (*Cluster) DoResourceLockFullSync

func (c *Cluster) DoResourceLockFullSync(node *gossip.Node) error

func (*Cluster) DoRoleFullSync

func (c *Cluster) DoRoleFullSync(node *gossip.Node) error

func (*Cluster) DoSessionFullSync

func (c *Cluster) DoSessionFullSync(node *gossip.Node) error

func (*Cluster) DoSpaceFullSync

func (c *Cluster) DoSpaceFullSync(node *gossip.Node) error

func (*Cluster) DoTemplateFullSync

func (c *Cluster) DoTemplateFullSync(node *gossip.Node) error

func (*Cluster) DoTemplateVarFullSync

func (c *Cluster) DoTemplateVarFullSync(node *gossip.Node) error

func (*Cluster) DoTokenFullSync

func (c *Cluster) DoTokenFullSync(node *gossip.Node) error

func (*Cluster) DoUserFullSync

func (c *Cluster) DoUserFullSync(node *gossip.Node) error

func (*Cluster) DoVolumeFullSync

func (c *Cluster) DoVolumeFullSync(node *gossip.Node) error

func (*Cluster) GetAgentEndpoints

func (c *Cluster) GetAgentEndpoints() []string

func (*Cluster) GetLocalNodeId added in v0.22.0

func (c *Cluster) GetLocalNodeId() (string, error)

func (*Cluster) GetNodeByIDString added in v0.22.0

func (c *Cluster) GetNodeByIDString(id string) *gossip.Node

func (*Cluster) GetTunnelServers

func (c *Cluster) GetTunnelServers() []string

func (*Cluster) GossipAuditLog

func (c *Cluster) GossipAuditLog(entry *model.AuditLogEntry)

func (*Cluster) GossipGroup

func (c *Cluster) GossipGroup(group *model.Group)

func (*Cluster) GossipResourceLock

func (c *Cluster) GossipResourceLock(resourceLock *ResourceLock)

func (*Cluster) GossipRole

func (c *Cluster) GossipRole(role *model.Role)

func (*Cluster) GossipSession

func (c *Cluster) GossipSession(session *model.Session)

func (*Cluster) GossipSpace

func (c *Cluster) GossipSpace(space *model.Space)

func (*Cluster) GossipTemplate

func (c *Cluster) GossipTemplate(template *model.Template)

func (*Cluster) GossipTemplateVar

func (c *Cluster) GossipTemplateVar(templateVar *model.TemplateVar)

func (*Cluster) GossipToken

func (c *Cluster) GossipToken(token *model.Token)

func (*Cluster) GossipUser

func (c *Cluster) GossipUser(user *model.User)

func (*Cluster) GossipVolume

func (c *Cluster) GossipVolume(volume *model.Volume)

func (*Cluster) HandleLeafServer

func (c *Cluster) HandleLeafServer(w http.ResponseWriter, r *http.Request)

func (*Cluster) LockResource

func (c *Cluster) LockResource(resourceId string) string

func (*Cluster) Nodes

func (c *Cluster) Nodes() []*gossip.Node

func (*Cluster) Start

func (c *Cluster) Start(peers []string, originServer string, originToken string)

func (*Cluster) Stop

func (c *Cluster) Stop()

func (*Cluster) UnlockResource

func (c *Cluster) UnlockResource(resourceId, unlockToken string)

type ResourceLock

type ResourceLock struct {
	Id           string
	UnlockToken  string
	IsDeleted    bool
	ExpiresAfter time.Time
	UpdatedAt    hlc.Timestamp
}

type ResourceLockRequestMsg

type ResourceLockRequestMsg struct {
	ResourceId string
}

type ResourceLockResponseMsg

type ResourceLockResponseMsg struct {
	UnlockToken string
}

type ResourceUnlockRequestMsg

type ResourceUnlockRequestMsg struct {
	ResourceId  string
	UnlockToken string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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