Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateReleaseRequest ¶
type CreateReleaseRequest struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
Body string `json:"body"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
TargetCommitish string `json:"target_commitish,omitempty"`
}
CreateReleaseRequest represents a request to create a GitHub release
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
GitHubClient handles communication with GitHub API
func NewGitHubClient ¶
func NewGitHubClient() *GitHubClient
NewGitHubClient creates a new GitHub API client
func (*GitHubClient) CreateRelease ¶
func (c *GitHubClient) CreateRelease(ctx context.Context, owner, repo string, release *CreateReleaseRequest) (*ReleaseInfo, error)
CreateRelease creates a new GitHub release
func (*GitHubClient) GetLatestRelease ¶
func (c *GitHubClient) GetLatestRelease(ctx context.Context, owner, repo string) (*ReleaseInfo, error)
GetLatestRelease fetches the latest release from GitHub
type GoUpgrader ¶
type GoUpgrader struct {
// contains filtered or unexported fields
}
GoUpgrader handles upgrades via go install
func (*GoUpgrader) GetUpgradeCommand ¶
func (u *GoUpgrader) GetUpgradeCommand() string
func (*GoUpgrader) Upgrade ¶
func (u *GoUpgrader) Upgrade(ctx context.Context, release *ReleaseInfo) error
type HomebrewUpgrader ¶
type HomebrewUpgrader struct {
// contains filtered or unexported fields
}
HomebrewUpgrader handles upgrades via Homebrew
func (*HomebrewUpgrader) GetUpgradeCommand ¶
func (u *HomebrewUpgrader) GetUpgradeCommand() string
func (*HomebrewUpgrader) Upgrade ¶
func (u *HomebrewUpgrader) Upgrade(ctx context.Context, release *ReleaseInfo) error
type InstallInfo ¶
type InstallInfo struct {
Method InstallMethod
BinaryPath string
Version string
Commit string
Date string
CanUpgrade bool
Reason string // Why it can't upgrade
}
InstallInfo contains information about the current shipyard installation
func DetectInstallation ¶
func DetectInstallation(version, commit, date string) (*InstallInfo, error)
DetectInstallation determines how shipyard was installed
type InstallMethod ¶
type InstallMethod int
InstallMethod represents how shipyard was installed
const ( InstallMethodUnknown InstallMethod = iota InstallMethodHomebrew InstallMethodNPM InstallMethodGo InstallMethodScript InstallMethodDocker )
func (InstallMethod) String ¶
func (m InstallMethod) String() string
String returns the human-readable name of the install method
type NPMUpgrader ¶
type NPMUpgrader struct {
// contains filtered or unexported fields
}
NPMUpgrader handles upgrades via npm
func (*NPMUpgrader) GetUpgradeCommand ¶
func (u *NPMUpgrader) GetUpgradeCommand() string
func (*NPMUpgrader) Upgrade ¶
func (u *NPMUpgrader) Upgrade(ctx context.Context, release *ReleaseInfo) error
type ReleaseAsset ¶
ReleaseAsset represents a downloadable asset from a GitHub release
type ReleaseInfo ¶
type ReleaseInfo struct {
TagName string
Name string
Body string
PublishedAt time.Time
Assets []ReleaseAsset
Prerelease bool
}
ReleaseInfo contains information about a GitHub release
type ScriptUpgrader ¶
type ScriptUpgrader struct {
// contains filtered or unexported fields
}
ScriptUpgrader handles upgrades for script/manual installations
func (*ScriptUpgrader) GetUpgradeCommand ¶
func (u *ScriptUpgrader) GetUpgradeCommand() string
func (*ScriptUpgrader) Upgrade ¶
func (u *ScriptUpgrader) Upgrade(ctx context.Context, release *ReleaseInfo) error
type Upgrader ¶
type Upgrader interface {
Upgrade(ctx context.Context, release *ReleaseInfo) error
GetUpgradeCommand() string
}
Upgrader defines the interface for upgrade strategies
func NewUpgrader ¶
func NewUpgrader(info *InstallInfo, log *logger.Logger) (Upgrader, error)
NewUpgrader creates an appropriate upgrader based on installation method