remoterun

package
v0.185.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package remoterun coordinates remote-store commands without Cobra.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeartbeatPhrase

func HeartbeatPhrase(machines []remotestate.Entry, login, machine string, now time.Time, none string) string

func HolderDesc

func HolderDesc(mine, theirs remotestate.Claim) string

func HolderStale

func HolderStale(machines []remotestate.Entry, login, machine string, now time.Time, stale time.Duration) bool

func RestartDaemonAfterEnroll

func RestartDaemonAfterEnroll(ctx context.Context, projectsRoot string) error

Types

type ClaimRequest

type ClaimRequest struct {
	ProjectsRoot, Task, Note string
	TakeOver, Force, JSON    bool
	Stale                    time.Duration
}

type ClaimResult

type ClaimResult struct {
	Outcome remotestate.ClaimOutcome
	Text    string
}

type ClaimRow

type ClaimRow struct {
	Task         string    `json:"task"`
	Holder       string    `json:"holder"`
	ClaimedAt    time.Time `json:"claimed_at"`
	HeartbeatAge string    `json:"heartbeat_age"`
	Stale        bool      `json:"stale"`
	Note         string    `json:"note,omitempty"`
	Error        string    `json:"error,omitempty"`
}

func ClaimRows

func ClaimRows(claims []remotestate.ClaimEntry, machines []remotestate.Entry, now time.Time, stale time.Duration) []ClaimRow

type Dependencies

type Dependencies struct {
	ConfigPath func() string
	Login      func() (string, error)
	Open       func(remotestate.Config, string) (remotestate.Provider, error)
	Now        func() time.Time
	ExitError  func(int, string) error
}

func DefaultDependencies

func DefaultDependencies(exitFactory func(int, string) error) Dependencies

type EnrollDependencies

type EnrollDependencies struct {
	ConfigPath func() string
	Verify     func(context.Context, string, string, string) error
	Restart    func(context.Context, string) error
}

func DefaultEnrollDependencies

func DefaultEnrollDependencies() EnrollDependencies

type EnrollRequest

type EnrollRequest struct {
	ProjectsRoot, Machine, HubURL, TokenFile string
	TokenStdin, RestartDaemon                bool
	Input                                    io.Reader
}

type EnrollResult

type EnrollResult struct {
	Machine       string `json:"machine"`
	HubURL        string `json:"hub_url"`
	ConfigPath    string `json:"config_path"`
	TokenFile     string `json:"token_file"`
	Verified      bool   `json:"verified"`
	DaemonRestart bool   `json:"daemon_restart"`
}

type EnrollService

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

func NewEnroll

func NewEnroll(deps EnrollDependencies, exitFactory func(int, string) error) *EnrollService

func (*EnrollService) Enroll

type MachineRow

type MachineRow struct {
	Key         string    `json:"key"`
	PublishedAt time.Time `json:"published_at"`
	Age         string    `json:"age"`
	SeenAt      time.Time `json:"seen_at"`
	Seen        string    `json:"seen"`
	Stale       bool      `json:"stale"`
	WBVersion   string    `json:"wb_version,omitempty"`
	Attention   int       `json:"attention"`
	Worktrees   int       `json:"worktrees"`
	Error       string    `json:"error,omitempty"`
}

func MachineRows

func MachineRows(entries []remotestate.Entry, now time.Time, stale time.Duration) []MachineRow

type ReleaseAdvisory

type ReleaseAdvisory struct {
	Outcome string `json:"outcome"`
	Detail  string `json:"detail,omitempty"`
}

func FailedAutoRelease

func FailedAutoRelease(out io.Writer, task, detail string) ReleaseAdvisory

func SkippedAutoRelease

func SkippedAutoRelease(out io.Writer, detail string) ReleaseAdvisory

func (ReleaseAdvisory) Leaked

func (r ReleaseAdvisory) Leaked() bool

type ReleaseRequest

type ReleaseRequest struct {
	ProjectsRoot, Task string
	Force              bool
}

type ReleaseResult

type ReleaseResult struct {
	Outcome remotestate.ReleaseOutcome
	Text    string
}

type Service

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

func New

func New(deps Dependencies) *Service

func (*Service) AutoClaim

func (s *Service) AutoClaim(root, task string, stale time.Duration, out io.Writer) worktreerun.RemoteClaimOutcome

func (*Service) AutoRelease

func (s *Service) AutoRelease(root, task string, out io.Writer) ReleaseAdvisory

func (*Service) Claim

func (s *Service) Claim(req ClaimRequest) (ClaimResult, error)

func (*Service) Claims

func (s *Service) Claims(root string, stale time.Duration) ([]ClaimRow, error)

func (*Service) Load

func (*Service) Machines

func (s *Service) Machines(root string, stale time.Duration) ([]MachineRow, error)

func (*Service) Release

func (s *Service) Release(req ReleaseRequest) (ReleaseResult, error)

func (*Service) Status

func (s *Service) Status(req StatusRequest, progress StatusProgress) (StatusResult, error)

type StatusDiagnostics

type StatusDiagnostics struct {
	Provider          string    `json:"provider"`
	Store             string    `json:"store"`
	ConfiguredMachine string    `json:"configured_machine"`
	RefreshedAt       time.Time `json:"refreshed_at"`
	StaleMachines     int       `json:"stale_machines"`
	UnknownProvenance int       `json:"unknown_provenance"`
	Mismatches        []string  `json:"mismatches,omitempty"`
}

type StatusProgress

type StatusProgress struct{ Start, Finish func(string) }

type StatusReport

type StatusReport struct {
	Diagnostics StatusDiagnostics   `json:"diagnostics"`
	Machines    []MachineRow        `json:"machines"`
	Entries     []remotestate.Entry `json:"entries"`
	Claims      []ClaimRow          `json:"claims"`
}

type StatusRequest

type StatusRequest struct {
	ProjectsRoot, Machine string
	Stale                 time.Duration
}

type StatusResult

type StatusResult struct {
	Report         StatusReport
	AllClaims      []ClaimRow
	MissingMachine bool
}

Jump to

Keyboard shortcuts

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