Documentation
¶
Index ¶
Constants ¶
View Source
const ( EventObjectAsset = "asset" EventObjectPolicy = "policy" EventObjectVerification = "verification" EventVerbDone = "done" EventVerbGet = "get" EventVerbRunning = "running" EventVerbSaved = "saved" EventVerbSkipped = "skipped" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Dropper ¶
type Dropper struct {
Options Options
// contains filtered or unexported fields
}
func New ¶
func New(funcs ...FuncOption) (*Dropper, error)
func (*Dropper) Get ¶
func (dropper *Dropper) Get(spec github.AssetDataProvider, funcs ...FuncGetOption) error
Get downloads and verifies an artifact from a GitHub release.
func (*Dropper) Install ¶
func (dropper *Dropper) Install(spec github.AssetDataProvider, funcs ...FuncGetOption) error
Install downloads, verifies and installs an artifact from a release
type Event ¶
func (*Event) GetDataField ¶
type FuncGetOption ¶
type FuncGetOption func(*GetOptions) error
func WithDownloadPath ¶
func WithDownloadPath(path string) FuncGetOption
func WithDownloadType ¶
func WithDownloadType(t string) FuncGetOption
func WithTransferTimeOut ¶
func WithTransferTimeOut(seconds int) FuncGetOption
func WithVerifyDownloads ¶
func WithVerifyDownloads(verify bool) FuncGetOption
type FuncOption ¶
func WithListener ¶
func WithListener(listener ProgressListener) FuncOption
type GetOptions ¶
type GetOptions struct {
// Embedded dropper options to pass to implementation
Options
// Directory where the asset will be downloaded
DownloadPath string
// Platform to download
OS string
Arch string
// Filename to store the downloaded asset
FileName string
// TransferTimeOut is the number of seconds after which the http request
// will time out.
TransferTimeOut int
// SkipVerification instructs the dropper engine to skip the artifact
// security verification. This allows the tool to be used as a curl-like
// thing for repos.
SkipVerification bool
// DownloadType is "a","b" or "p" and determines which download we do
DownloadType string
// contains filtered or unexported fields
}
type NoopListener ¶
type NoopListener struct{}
NoopListener is a listener tht just swallows events without doing anything
func (*NoopListener) HandleEvent ¶
func (*NoopListener) HandleEvent(event *Event)
type Options ¶
type Options struct {
PolicyRepository string
Listener ProgressListener
}
type ProgressListener ¶
type ProgressListener interface {
HandleEvent(event *Event)
}
ProgressListener is an object that reacts to the events from the downloader.
Click to show internal directories.
Click to hide internal directories.