Documentation
¶
Overview ¶
Package update finds, installs, and restarts onto codeaf releases.
Index ¶
- Constants
- func ChannelTag(channel, date, sha string) (string, error)
- func CleanupOld(string)
- func CleanupOldRunning(func() (string, error))
- func CompareSemverTags(left, right string) (int, bool)
- func ExecutableTarget(executable func() (string, error)) (string, error)
- func Kind(tag string) string
- func NextSemverTag(tags []string, channel, component string) (string, error)
- func Restart(plan Plan) error
- func RestartArgs(original []string, transcript string) []string
- func ValidDate(value string) bool
- func ValidSHA(value string) bool
- type Available
- type CheckOptions
- type Choice
- type Client
- type InstallOptions
- type InstallResult
- type Plan
- type RCTag
- type Release
- type Version
Constants ¶
const ( // CurlCommand is the independent installation road shown at launch beside // /update and after a failed or unavailable in-place update. IT IS THE // SUPPORTED LINE, NOT THE SCRIPT UNDER IT: agentfield.ai/get/codeaf serves // scripts/install.sh from main, and the address is the one a person can // remember and the one every other place codeaf documents spells, so a // launch line and the README can never hand out two different roads. CurlCommand = "curl -fsSL https://agentfield.ai/get/codeaf | bash" NoUpdateCheckEnv = "CODEAF_NO_UPDATE_CHECK" GitHubAPIEnv = "CODEAF_GITHUB_API" GitHubDownloadEnv = "CODEAF_GITHUB_DOWNLOAD" )
const ( // CheckTimeout is the whole-exchange budget for a launch check and for // `codeaf update --check`. THE CHECK CLOCK NEVER COVERS AN INSTALL: a // release asset is allowed to make steady progress for much longer. CheckTimeout = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ChannelTag ¶
ChannelTag forms a dev or staging tag from a date and revision.
func CleanupOld ¶
func CleanupOld(string)
CleanupOld removes nothing on systems where the running executable can be replaced directly.
func CleanupOldRunning ¶
CleanupOldRunning does nothing where replacing a running executable leaves no backup. In particular, it does not resolve the executable during launch.
func CompareSemverTags ¶
CompareSemverTags orders stable and release-candidate tags. A stable tag follows every release candidate on its own version line.
func ExecutableTarget ¶
ExecutableTarget resolves the running binary before an installer replaces it.
func NextSemverTag ¶
NextSemverTag returns the next stable or release-candidate tag.
func RestartArgs ¶
RestartArgs keeps the original launch shape and points it at this transcript.
Types ¶
type Available ¶
Available is the stable release comparison shown at launch or by --check.
func CheckLaunch ¶
func CheckLaunch(ctx context.Context, options CheckOptions) (Available, bool)
CheckLaunch silently checks the newest stable release when this build is a stable or release-candidate build. Every failure is absence at this surface.
type CheckOptions ¶
type CheckOptions struct {
Running string
ProfileDir string
Client *Client
Now func() time.Time
Disabled bool
}
CheckOptions supplies the launch policy's disk, clock, and release client.
type Client ¶
type Client struct {
HTTP *http.Client
APIBase string
DownloadBase string
Token string
Revision string
CheckWindow time.Duration
APIWindow time.Duration
StallWindow time.Duration
DownloadCeiling time.Duration
}
Client talks to the release API and release asset host.
func NewClient ¶
NewClient builds the release client from the same mirror and token inputs as the shell installer. The timeout belongs only to the small release check; every install request carries the clock for the particular thing it reads.
type InstallOptions ¶
type InstallOptions struct {
Client *Client
Release Release
Target string
GOOS string
GOARCH string
}
InstallOptions describes one in-place replacement.
type InstallResult ¶
InstallResult is the release and executable path that are ready to restart.
func Install ¶
func Install(ctx context.Context, options InstallOptions) (InstallResult, error)
Install downloads, checks, and atomically replaces one executable.