Documentation
¶
Overview ¶
Package update fetches signed codexctl releases from GitHub and replaces the running executable.
Index ¶
- Constants
- func Apply(exe string, binary []byte) error
- func AssetName(version string) string
- func CompareVersions(a, b string) int
- func DecodePrivateKey(encoded string) (ed25519.PrivateKey, error)
- func DecodePublicKey(encoded string) (ed25519.PublicKey, error)
- func Executable() (string, error)
- func ExtractBinary(archive []byte, name string) ([]byte, error)
- func GenerateKey() (public, private string, err error)
- func PublicKey() (ed25519.PublicKey, error)
- func Remove(exe string) error
- func Sign(key ed25519.PrivateKey, data []byte) []byte
- func Verify(key ed25519.PublicKey, data, signature []byte) error
- type Client
- type Method
- type Release
Constants ¶
View Source
const (
Repo = "AbdelrhmanSaid/codexctl"
)
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply renames the new file into place, which is atomic on POSIX. On Windows the old file is moved aside first.
func CompareVersions ¶
CompareVersions sorts a prerelease before its release.
func DecodePrivateKey ¶
func DecodePrivateKey(encoded string) (ed25519.PrivateKey, error)
func Executable ¶
Executable follows symlinks, such as one from a manual install into ~/bin.
func GenerateKey ¶
GenerateKey returns the public key embedded in the binary and the private key kept as a CI secret.
Types ¶
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
PublicKey ed25519.PublicKey
// ReleasesURL is pointed elsewhere by tests.
ReleasesURL string
// Progress gets a total of -1 when it is unknown.
Progress func(done, total int64)
}
type Method ¶
type Method int
func DetectInstall ¶
DetectInstall takes whether GoReleaser stamped a version into the binary.
Click to show internal directories.
Click to hide internal directories.