client

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStatePath

func DefaultStatePath(homeDir string) string

func RemoveState

func RemoveState(path string) error

func SaveState

func SaveState(path string, state LocalState) error

Types

type Client

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

func New

func New(baseURL, nodeToken string, httpClient *http.Client) *Client

func (*Client) ExpireLease

func (c *Client) ExpireLease(ctx context.Context, fencingToken int64) (protocol.CoordinatorLease, error)

func (*Client) Heartbeat

func (*Client) Join

func (*Client) Leave

func (c *Client) Leave(ctx context.Context) error

func (*Client) RevalidateLease

func (*Client) Status

func (*Client) WebhookSecret

func (c *Client) WebhookSecret(ctx context.Context) (string, error)

type LocalState

type LocalState struct {
	URL       string                  `json:"url"`
	NetworkID string                  `json:"networkId"`
	NodeID    string                  `json:"nodeId"`
	NodeName  string                  `json:"nodeName"`
	NodeToken string                  `json:"nodeToken"`
	GitHub    protocol.GitHubIdentity `json:"github"`
}

func LoadState

func LoadState(path string) (LocalState, error)

type Manager

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

func NewManager

func NewManager(statePath string, cfg config.Config, repos *storage.Repositories, gh *githubinfra.Gateway) *Manager

func (*Manager) Start

func (m *Manager) Start(parent context.Context) error

func (*Manager) Status

func (m *Manager) Status() Status

func (*Manager) Stop

func (m *Manager) Stop()

func (*Manager) UpdateConfig added in v0.10.4

func (m *Manager) UpdateConfig(cfg config.Config)

type Status

type Status struct {
	Configured       bool                      `json:"configured"`
	NetworkID        string                    `json:"networkId,omitempty"`
	NodeID           string                    `json:"nodeId,omitempty"`
	NodeName         string                    `json:"nodeName,omitempty"`
	GitHub           protocol.GitHubIdentity   `json:"github"`
	CurrentGitHub    protocol.GitHubIdentity   `json:"currentGithub"`
	CloudReachable   bool                      `json:"cloudReachable"`
	Warnings         []string                  `json:"warnings,omitempty"`
	Lease            protocol.CoordinatorLease `json:"lease"`
	RoutedProjects   int                       `json:"routedProjects"`
	LocalProjects    int                       `json:"localProjects"`
	IdentityDrift    bool                      `json:"identityDrift"`
	DriftReason      string                    `json:"driftReason,omitempty"`
	IdentityFallback bool                      `json:"identityFallback,omitempty"`
	LeaseAction      string                    `json:"leaseAction,omitempty"`
	LeaseError       string                    `json:"leaseError,omitempty"`
	LeaseHolder      *protocol.Membership      `json:"leaseHolder,omitempty"`
	Membership       *protocol.Membership      `json:"membership,omitempty"`
	LastHeartbeatAt  *time.Time                `json:"lastHeartbeatAt,omitempty"`
}

Jump to

Keyboard shortcuts

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