Documentation
¶
Index ¶
- Constants
- func AssetName(platform Platform) (string, error)
- func CompareVersions(left string, right string) (int, error)
- func ExtractMoltnetBinary(archive []byte, destinationDir string) (string, error)
- func IsDevelopmentVersion(version string) bool
- func NormalizeVersion(version string) string
- func ReplaceBinary(installPath string, replacementPath string) (string, error)
- func VerifyChecksum(assetName string, archive []byte, manifest []byte) error
- func WriteResult(writer io.Writer, result Result) error
- type DefaultInstallDetector
- type HTTPClient
- type HTTPReleaseSource
- func (s HTTPReleaseSource) Archive(ctx context.Context, version string, assetName string) ([]byte, error)
- func (s HTTPReleaseSource) Checksums(ctx context.Context, version string) ([]byte, error)
- func (s HTTPReleaseSource) InstallMetadata() ReleaseSourceMetadata
- func (s HTTPReleaseSource) LatestVersion(ctx context.Context) (string, error)
- type HTTPServerProbe
- type Install
- type InstallDetector
- type InstallMethod
- type Options
- type Platform
- type ReleaseSource
- type ReleaseSourceMetadata
- type Result
- type ServerInfo
- type ServerProbe
- type ServerProbeRequest
Constants ¶
View Source
const DefaultServerTokenEnv = "MOLTNET_UPDATE_SERVER_TOKEN"
Variables ¶
This section is empty.
Functions ¶
func ExtractMoltnetBinary ¶
func IsDevelopmentVersion ¶
func NormalizeVersion ¶
Types ¶
type DefaultInstallDetector ¶
type DefaultInstallDetector struct{}
func (DefaultInstallDetector) DetectInstall ¶
type HTTPReleaseSource ¶
type HTTPReleaseSource struct {
APIBase string
Client HTTPClient
DownloadBaseURL string
GitHubBase string
OwnerRepo string
}
func NewHTTPReleaseSource ¶
func NewHTTPReleaseSource(client HTTPClient) HTTPReleaseSource
func (HTTPReleaseSource) InstallMetadata ¶
func (s HTTPReleaseSource) InstallMetadata() ReleaseSourceMetadata
func (HTTPReleaseSource) LatestVersion ¶
func (s HTTPReleaseSource) LatestVersion(ctx context.Context) (string, error)
type HTTPServerProbe ¶
type HTTPServerProbe struct {
Client HTTPClient
}
func (HTTPServerProbe) ProbeServer ¶
func (p HTTPServerProbe) ProbeServer(ctx context.Context, probe ServerProbeRequest) (ServerInfo, error)
type Install ¶
type Install struct {
Method InstallMethod
Path string
SelfUpdateAllowed bool
}
type InstallDetector ¶
type InstallMethod ¶
type InstallMethod string
const ( InstallMethodReleaseTarball InstallMethod = "release-tarball" InstallMethodSource InstallMethod = "source" InstallMethodContainer InstallMethod = "container" InstallMethodUnknown InstallMethod = "unknown" )
type Options ¶
type Options struct {
CheckOnly bool
CurrentVersion string
Detector InstallDetector
DryRun bool
LockPath string
LockStaleAfter time.Duration
Platform Platform
ReleaseSource ReleaseSource
ServerProbe ServerProbe
ServerToken string
ServerTokenEnv string
ServerURL string
TargetVersion string
TempDir string
Yes bool
}
type Platform ¶
func CurrentPlatform ¶
func CurrentPlatform() Platform
func (Platform) WithDefaults ¶
type ReleaseSource ¶
type ReleaseSourceMetadata ¶
type Result ¶
type ServerInfo ¶
type ServerProbe ¶
type ServerProbe interface {
ProbeServer(ctx context.Context, request ServerProbeRequest) (ServerInfo, error)
}
type ServerProbeRequest ¶
Click to show internal directories.
Click to hide internal directories.