cluster

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 36 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
	ScriptFullSyncMsg
	ScriptGossipMsg
	SkillFullSyncMsg
	SkillGossipMsg
	StackDefinitionFullSyncMsg
	StackDefinitionGossipMsg
	ResponseFullSyncMsg
	ResponseGossipMsg
	SpaceUsageFullSyncMsg
	SpaceUsageGossipMsg
	SpaceMigrationStartMsg
	ToolApprovalResponseMsg
)
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,
	tcpOnly 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) DoResponseFullSync added in v0.23.0

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

func (*Cluster) DoRoleFullSync

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

func (*Cluster) DoScriptFullSync added in v0.23.0

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

func (*Cluster) DoSessionFullSync

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

func (*Cluster) DoSkillFullSync added in v0.23.0

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

func (*Cluster) DoSpaceFullSync

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

func (*Cluster) DoSpaceUsageFullSync added in v0.24.0

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

func (*Cluster) DoStackDefinitionFullSync added in v0.24.0

func (c *Cluster) DoStackDefinitionFullSync(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) EnqueueSpaceCleanup added in v0.25.0

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

func (*Cluster) ForwardToolApproval added in v0.25.1

func (c *Cluster) ForwardToolApproval(req *toolapproval.ResponseRequest) (bool, error)

ForwardToolApproval sends an approval response to the instance that owns the pending request via gossip.

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) GossipResponse added in v0.23.0

func (c *Cluster) GossipResponse(response *model.Response)

func (*Cluster) GossipRole

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

func (*Cluster) GossipScript added in v0.23.0

func (c *Cluster) GossipScript(script *model.Script)

func (*Cluster) GossipSession

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

func (*Cluster) GossipSkill added in v0.23.0

func (c *Cluster) GossipSkill(skill *model.Skill)

func (*Cluster) GossipSpace

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

func (*Cluster) GossipSpaceUsageSample added in v0.24.0

func (c *Cluster) GossipSpaceUsageSample(sample *model.SpaceUsageSample)

func (*Cluster) GossipStackDefinition added in v0.24.0

func (c *Cluster) GossipStackDefinition(stackDef *model.StackDefinition)

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