Documentation ¶
Index ¶
- Variables
- func BuildConfigurationFilename(paths ...string) string
- func GetCacheFilename(v vfs.FS) string
- func GetOSConfigPath(homePath string) string
- type Application
- func (app *Application) DetectAssets(assetWrapper *AssetWrapper) (*detectors.DetectionResult, error)
- func (app *Application) Download(url string, out io.Writer) error
- func (app *Application) DownloadAndVerify(assetWrapper *AssetWrapper, findResult *finders.FindResult) ([]byte, *ReturnStatus)
- func (app *Application) DownloadClient() *download.Client
- func (app *Application) ExtractBins(bin ExtractedFile, bins []ExtractedFile, extractAll bool) int
- func (app *Application) ExtractDownloadedAsset(assetWrapper *AssetWrapper, body []byte, finder *finders.ValidFinder) (int, *ReturnStatus)
- func (app *Application) FilterDetectedAssets(detected *detectors.DetectionResult, findResult *finders.FindResult) *ReturnStatus
- func (app *Application) Find() (*finders.ValidFinder, *finders.FindResult)
- func (app *Application) ProcessCommands(target string) string
- func (app *Application) ProcessFilters(finder *finders.ValidFinder, findResult *finders.FindResult) *ReturnStatus
- func (app *Application) ProcessFlags(errorHandler ProcessFlagsErrorHandlerFunc) (string, error)
- func (app *Application) RateLimitExceeded() error
- func (app *Application) RefreshRateLimit() error
- func (app *Application) Run() *ReturnStatus
- func (app *Application) RunSetup(_ ProcessFlagsErrorHandlerFunc) (string, *ReturnStatus)
- func (app *Application) SetGlobalOptionsFromConfig() error
- func (app *Application) SetProjectOptionsFromConfig(projectName string) error
- func (app *Application) ToolName() string
- func (app *Application) VerifyChecksums(wrapper *AssetWrapper, body []byte) verifiers.VerifyChecksumResult
- func (app *Application) Write(format string, args ...any) (n int, err error)
- func (app *Application) WriteCheck(newLine bool)
- func (app *Application) WriteError(format string, args ...any)
- func (app *Application) WriteErrorLine(format string, args ...any)
- func (app *Application) WriteLine(format string, args ...any) (n int, err error)
- func (app *Application) WriteVerbose(format string, args ...any) (n int, err error)
- func (app *Application) WriteVerboseLine(format string, args ...any) (n int, err error)
- type ApplicationOutputs
- type Config
- type ConfigGlobal
- type ConfigRepository
- type ProcessFlagsErrorHandlerFunc
- type ReturnStatus
- type ReturnStatusCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoTargetGiven = errors.New("no target given")
View Source
var ErrNoToken = errors.New("no github token")
View Source
var ErrSuccess = errors.New("success")
Functions ¶
func GetCacheFilename ¶
func GetCacheFilename(v vfs.FS) string
func GetOSConfigPath ¶
Types ¶
type Application ¶
type Application struct { Output io.Writer Outputs *ApplicationOutputs Opts Flags Args []string Config *Config Cache data.Cache Filesystem vfs.FS Reference *RepositoryReference Registry *registry.LockFile Target string TargetFound bool // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication(outputs *ApplicationOutputs) *Application
func (*Application) DetectAssets ¶
func (app *Application) DetectAssets(assetWrapper *AssetWrapper) (*detectors.DetectionResult, error)
func (*Application) Download ¶
func (app *Application) Download(url string, out io.Writer) error
Download the file at 'url' and write the http response body to 'out'. The 'getbar' function allows the caller to construct a progress bar given the size of the file being downloaded, and the download will write to the returned progress bar.
func (*Application) DownloadAndVerify ¶
func (app *Application) DownloadAndVerify(assetWrapper *AssetWrapper, findResult *finders.FindResult) ([]byte, *ReturnStatus)
func (*Application) DownloadClient ¶
func (app *Application) DownloadClient() *download.Client
func (*Application) ExtractBins ¶
func (app *Application) ExtractBins(bin ExtractedFile, bins []ExtractedFile, extractAll bool) int
func (*Application) ExtractDownloadedAsset ¶
func (app *Application) ExtractDownloadedAsset(assetWrapper *AssetWrapper, body []byte, finder *finders.ValidFinder) (int, *ReturnStatus)
func (*Application) FilterDetectedAssets ¶
func (app *Application) FilterDetectedAssets(detected *detectors.DetectionResult, findResult *finders.FindResult) *ReturnStatus
func (*Application) Find ¶
func (app *Application) Find() (*finders.ValidFinder, *finders.FindResult)
func (*Application) ProcessCommands ¶
func (app *Application) ProcessCommands(target string) string
func (*Application) ProcessFilters ¶
func (app *Application) ProcessFilters(finder *finders.ValidFinder, findResult *finders.FindResult) *ReturnStatus
func (*Application) ProcessFlags ¶
func (app *Application) ProcessFlags(errorHandler ProcessFlagsErrorHandlerFunc) (string, error)
func (*Application) RateLimitExceeded ¶
func (app *Application) RateLimitExceeded() error
func (*Application) RefreshRateLimit ¶
func (app *Application) RefreshRateLimit() error
func (*Application) Run ¶
func (app *Application) Run() *ReturnStatus
func (*Application) RunSetup ¶
func (app *Application) RunSetup(_ ProcessFlagsErrorHandlerFunc) (string, *ReturnStatus)
func (*Application) SetGlobalOptionsFromConfig ¶
func (app *Application) SetGlobalOptionsFromConfig() error
Move the loaded configuration file global options into the opts variable
func (*Application) SetProjectOptionsFromConfig ¶
func (app *Application) SetProjectOptionsFromConfig(projectName string) error
Move the loaded configuration file project options into the opts variable
func (*Application) ToolName ¶
func (app *Application) ToolName() string
func (*Application) VerifyChecksums ¶
func (app *Application) VerifyChecksums(wrapper *AssetWrapper, body []byte) verifiers.VerifyChecksumResult
func (*Application) Write ¶
func (app *Application) Write(format string, args ...any) (n int, err error)
func (*Application) WriteCheck ¶
func (app *Application) WriteCheck(newLine bool)
func (*Application) WriteError ¶
func (app *Application) WriteError(format string, args ...any)
func (*Application) WriteErrorLine ¶
func (app *Application) WriteErrorLine(format string, args ...any)
func (*Application) WriteLine ¶
func (app *Application) WriteLine(format string, args ...any) (n int, err error)
func (*Application) WriteVerbose ¶
func (app *Application) WriteVerbose(format string, args ...any) (n int, err error)
func (*Application) WriteVerboseLine ¶
func (app *Application) WriteVerboseLine(format string, args ...any) (n int, err error)
type ApplicationOutputs ¶
func NewApplicationOutputs ¶
func NewApplicationOutputs(stdout io.Writer, stderr io.Writer) *ApplicationOutputs
type Config ¶
type Config struct { Meta struct { Keys []string MetaData *toml.MetaData } Global ConfigGlobal `toml:"global"` Repositories map[string]ConfigRepository }
func LoadConfigurationFile ¶
type ConfigGlobal ¶
type ConfigGlobal struct { All bool `toml:"all"` DownloadOnly bool `toml:"download_only"` File string `toml:"file"` GithubToken string `toml:"github_token"` Quiet bool `toml:"quiet"` ShowHash bool `toml:"show_hash"` Source bool `toml:"download_source"` System string `toml:"system"` Target string `toml:"target"` UpgradeOnly bool `toml:"upgrade_only"` RemoveExisting bool `toml:"remove_existing"` IgnorePatterns []string `toml:"ignore_patterns"` }
type ConfigRepository ¶
type ConfigRepository struct { All bool `toml:"all"` AssetFilters []string `toml:"asset_filters"` DownloadOnly bool `toml:"download_only"` File string `toml:"file"` Name string `toml:"name"` Quiet bool `toml:"quiet"` ShowHash bool `toml:"show_hash"` Source bool `toml:"download_source"` System string `toml:"system"` Tag string `toml:"tag"` Target string `toml:"target"` UpgradeOnly bool `toml:"upgrade_only"` Verify string `toml:"verify_sha256"` DisableSSL bool `toml:"disable_ssl"` RemoveExisting bool `toml:"remove_existing"` }
type ReturnStatus ¶
type ReturnStatus struct { Code ReturnStatusCode Err error Msg string }
func NewReturnStatus ¶
func NewReturnStatus(code ReturnStatusCode, err error, msg string) *ReturnStatus
type ReturnStatusCode ¶
type ReturnStatusCode int
const ( Success ReturnStatusCode = iota Failure ReturnStatusCode = -1 FatalError ReturnStatusCode = -2 )
Click to show internal directories.
Click to hide internal directories.