Documentation
¶
Index ¶
- Constants
- func CreateConfigFile(cfgPath string) error
- func DecoderConfigOption(cfg *Config) func(*mapstructure.DecoderConfig)
- func Pick(root, expr string) error
- func ReconcilePackage(packagesDir string, states *StateData, spec PackageSpec, ch chan<- *Event, ...) error
- func SpecEqual(a, b PackageSpec) bool
- type CommonSpec
- type Config
- type Downloader
- type Event
- type EventBuilder
- type EventDataDownload
- type EventDataSkipped
- type EventType
- type GitHubRelease
- type GitHubReleaseSpec
- type HTTPDownloader
- type NopSpec
- type PackageSpec
- type Source
- type State
- type StateData
Constants ¶
View Source
const Version = "v0.1.0"
Variables ¶
This section is empty.
Functions ¶
func CreateConfigFile ¶
func DecoderConfigOption ¶
func DecoderConfigOption(cfg *Config) func(*mapstructure.DecoderConfig)
func ReconcilePackage ¶
func SpecEqual ¶
func SpecEqual(a, b PackageSpec) bool
Types ¶
type CommonSpec ¶
type CommonSpec struct { From string `json:"from"` Pick string `json:"pick,omitempty"` Ref string `json:"ref,omitempty"` ID string `json:"id,omitempty"` // contains filtered or unexported fields }
func (*CommonSpec) Common ¶
func (s *CommonSpec) Common() *CommonSpec
func (*CommonSpec) DisplayName ¶
func (s *CommonSpec) DisplayName() string
func (*CommonSpec) Validate ¶
func (s *CommonSpec) Validate() error
type Config ¶
type Config struct { CachePath string `json:"cache_path"` Specs []PackageSpec `json:"packages"` }
func (*Config) GetPackagesPath ¶
type Downloader ¶
type Downloader interface { io.ReadCloser GetAssetName() string GetContentLength() int64 }
type Event ¶
type Event struct { Type EventType Spec PackageSpec Data interface{} }
type EventBuilder ¶
type EventBuilder struct {
// contains filtered or unexported fields
}
type EventDataDownload ¶
type EventDataSkipped ¶
type EventDataSkipped struct {
CurrentRef string
}
type GitHubRelease ¶
type GitHubRelease struct {
// contains filtered or unexported fields
}
func NewGitHubRelease ¶
func NewGitHubRelease(name, ref string, client releaseGetter) (*GitHubRelease, error)
func (*GitHubRelease) GetDownloader ¶
func (ghr *GitHubRelease) GetDownloader() (Downloader, error)
func (*GitHubRelease) ShouldUpdate ¶
func (ghr *GitHubRelease) ShouldUpdate(currentRef string) (bool, string, error)
type GitHubReleaseSpec ¶
type GitHubReleaseSpec struct { *CommonSpec Repo string `json:"repo"` }
func (*GitHubReleaseSpec) DisplayName ¶
func (s *GitHubReleaseSpec) DisplayName() string
func (*GitHubReleaseSpec) PackagePath ¶
func (s *GitHubReleaseSpec) PackagePath() string
func (*GitHubReleaseSpec) Unique ¶
func (s *GitHubReleaseSpec) Unique() string
func (*GitHubReleaseSpec) Validate ¶
func (s *GitHubReleaseSpec) Validate() error
type HTTPDownloader ¶
type HTTPDownloader struct { io.ReadCloser // contains filtered or unexported fields }
func NewHTTPDownloader ¶
func NewHTTPDownloader(name, url string) (*HTTPDownloader, error)
func (*HTTPDownloader) GetAssetName ¶
func (dl *HTTPDownloader) GetAssetName() string
func (*HTTPDownloader) GetContentLength ¶
func (dl *HTTPDownloader) GetContentLength() int64
type NopSpec ¶
type NopSpec struct {
*CommonSpec
}
NopSpec implements PackageSpec interface and its methods do nothing. You can use this struct in test code.
func NewNopSpec ¶
func (*NopSpec) PackagePath ¶
type PackageSpec ¶
type PackageSpec interface { Common() *CommonSpec Validate() error DisplayName() string PackagePath() string Unique() string }
type State ¶
type State struct { Spec PackageSpec `json:"spec"` Path string `json:"path"` Ref string `json:"ref"` }
type StateData ¶
type StateData struct {
States []State `json:"states"`
}
func LoadStateDataFromFile ¶
func (*StateData) SaveToFile ¶
func (*StateData) Upsert ¶
func (sd *StateData) Upsert(spec PackageSpec, ref string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.