Documentation
¶
Overview ¶
Package remoterun coordinates remote-store commands without Cobra.
Index ¶
- func HeartbeatPhrase(machines []remotestate.Entry, login, machine string, now time.Time, ...) string
- func HolderDesc(mine, theirs remotestate.Claim) string
- func HolderStale(machines []remotestate.Entry, login, machine string, now time.Time, ...) bool
- func RestartDaemonAfterEnroll(ctx context.Context, projectsRoot string) error
- type ClaimRequest
- type ClaimResult
- type ClaimRow
- type Dependencies
- type EnrollDependencies
- type EnrollRequest
- type EnrollResult
- type EnrollService
- type MachineRow
- type ReleaseAdvisory
- type ReleaseRequest
- type ReleaseResult
- type Service
- func (s *Service) AutoClaim(root, task string, stale time.Duration, out io.Writer) worktreerun.RemoteClaimOutcome
- func (s *Service) AutoRelease(root, task string, out io.Writer) ReleaseAdvisory
- func (s *Service) Claim(req ClaimRequest) (ClaimResult, error)
- func (s *Service) Claims(root string, stale time.Duration) ([]ClaimRow, error)
- func (s *Service) Load(root string) (remotestate.Config, remotestate.Provider, error)
- func (s *Service) Machines(root string, stale time.Duration) ([]MachineRow, error)
- func (s *Service) Release(req ReleaseRequest) (ReleaseResult, error)
- func (s *Service) Status(req StatusRequest, progress StatusProgress) (StatusResult, error)
- type StatusDiagnostics
- type StatusProgress
- type StatusReport
- type StatusRequest
- type StatusResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeartbeatPhrase ¶
func HolderDesc ¶
func HolderDesc(mine, theirs remotestate.Claim) string
func HolderStale ¶
Types ¶
type ClaimRequest ¶
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 EnrollResult ¶
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 ¶
func (s *EnrollService) Enroll(ctx context.Context, req EnrollRequest) (EnrollResult, error)
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 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) Load ¶
func (s *Service) Load(root string) (remotestate.Config, remotestate.Provider, 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 StatusResult ¶
type StatusResult struct {
Report StatusReport
AllClaims []ClaimRow
MissingMachine bool
}
Click to show internal directories.
Click to hide internal directories.