Documentation
¶
Index ¶
- Constants
- func New() (stoic.Stoic, error)
- func NewWithOptions(o EngineOptions) (stoic.Stoic, error)
- func RegisterGetter(name string, ctor GetterCtor)
- func RegisterRunner(name string, ctor RunnerCtor)
- type EngineOptions
- type GetterCtor
- type RunnerCtor
- type State
- type ToolChannelInfoFormat
- type ToolCheckoutFormat
- type ToolStateFormat
- type UnixTimestamp
Constants ¶
View Source
const ( GitGetterType = "git" GithubReleaseGetterType = "github-release" GoGetGetterType = "go-get" GoBuildRunnerType = "go-build" Python2RunnerType = "python2" Python3RunnerType = "python3" PythonRunnerType = "python" ShellRunnerType = "shell" )
View Source
const ( DefaultToolUpdateFrequency = tool.UpdateWeekly DefaultToolGetterType = GitGetterType DefaultToolRunnerType = ShellRunnerType )
Variables ¶
This section is empty.
Functions ¶
func NewWithOptions ¶
func NewWithOptions(o EngineOptions) (stoic.Stoic, error)
func RegisterGetter ¶
func RegisterGetter(name string, ctor GetterCtor)
func RegisterRunner ¶
func RegisterRunner(name string, ctor RunnerCtor)
Types ¶
type EngineOptions ¶
type EngineOptions struct {
Root string
UpdateFrequency tool.UpdateFrequency
}
type State ¶
type State interface {
// ToolId identifies the tool the instance pertains too.
ToolId() string
// Filename returns the filesystem path where the state is persisted.
Filename() string
// UpstreamVersion returns the latest upstream version of the tool that is
// available locally, for the specified channel.
UpstreamVersion(tc tool.Channel) tool.Version
// LastUpstreamUpdate returns the time at which the upstream version for the
// specified channel was last updated.
LastUpstreamUpdate(tc tool.Channel) time.Time
// CurrentCheckout returns the most recent checkout marked as current.
CurrentCheckout() tool.Checkout
// CheckoutForVersion returns the most recent checkout for the requested
// version.
CheckoutForVersion(version tool.Version) tool.Checkout
}
State represents metadata persisted by the engine for a given tool.
type ToolChannelInfoFormat ¶
type ToolChannelInfoFormat struct {
Version tool.Version `json:"version,omitempty"`
LastUpdate UnixTimestamp `json:"last-update,omitempty"`
}
ToolChannelInfoFormat defines the low-level format for persisting information about an upstream source.
type ToolCheckoutFormat ¶
type ToolCheckoutFormat struct {
CheckoutVersion tool.Version `json:"version"`
CheckoutPath string `json:"path"`
Created UnixTimestamp `json:"created"`
SetCurrent UnixTimestamp `json:"set-current,omitempty"`
}
ToolCheckoutFormat defines the low-level format for persisting information about a tool.Checkout.
func (ToolCheckoutFormat) Path ¶
func (tcf ToolCheckoutFormat) Path() string
func (ToolCheckoutFormat) Version ¶
func (tcf ToolCheckoutFormat) Version() tool.Version
type ToolStateFormat ¶
type ToolStateFormat struct {
Upstream *ToolChannelInfoFormat `json:"upstream,omitempty"`
Channels map[tool.Channel]ToolChannelInfoFormat `json:"channels,omitempty"`
Checkouts []ToolCheckoutFormat `json:"checkouts,omitempty"`
}
ToolStateFormat defines the low-level format for persisting State.
func (*ToolStateFormat) CheckoutForVersion ¶
func (tsf *ToolStateFormat) CheckoutForVersion(version tool.Version) tool.Checkout
func (*ToolStateFormat) CurrentCheckout ¶
func (tsf *ToolStateFormat) CurrentCheckout() tool.Checkout
func (*ToolStateFormat) LastUpstreamUpdate ¶
func (tsf *ToolStateFormat) LastUpstreamUpdate(tc tool.Channel) time.Time
func (*ToolStateFormat) UpstreamVersion ¶
func (tsf *ToolStateFormat) UpstreamVersion(tc tool.Channel) tool.Version
type UnixTimestamp ¶
type UnixTimestamp int64
Click to show internal directories.
Click to hide internal directories.