Documentation ¶
Overview ¶
Package context provides single entry to all resources
Index ¶
- func Fatal(err error)
- type AptlyContext
- func (context *AptlyContext) ArchitecturesList() []string
- func (context *AptlyContext) Cleanup()
- func (context *AptlyContext) CloseDatabase() error
- func (context *AptlyContext) CollectionFactory() *deb.CollectionFactory
- func (context *AptlyContext) Config() *utils.ConfigStructure
- func (context *AptlyContext) DBPath() string
- func (context *AptlyContext) Database() (database.Storage, error)
- func (context *AptlyContext) DependencyOptions() int
- func (context *AptlyContext) Downloader() aptly.Downloader
- func (context *AptlyContext) Flags() *flag.FlagSet
- func (context *AptlyContext) GetPublishedStorage(name string) aptly.PublishedStorage
- func (context *AptlyContext) GetSigner() pgp.Signer
- func (context *AptlyContext) GetVerifier() pgp.Verifier
- func (context *AptlyContext) GlobalFlags() *flag.FlagSet
- func (context *AptlyContext) LookupOption(defaultValue bool, name string) (result bool)
- func (context *AptlyContext) PackagePool() aptly.PackagePool
- func (context *AptlyContext) Progress() aptly.Progress
- func (context *AptlyContext) ReOpenDatabase() error
- func (context *AptlyContext) Shutdown()
- func (context *AptlyContext) UpdateFlags(flags *flag.FlagSet)
- func (context *AptlyContext) UploadPath() string
- type FatalError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AptlyContext ¶
AptlyContext is a common context shared by all commands
func NewContext ¶
func NewContext(flags *flag.FlagSet) (*AptlyContext, error)
NewContext initializes context with default settings
func (*AptlyContext) ArchitecturesList ¶
func (context *AptlyContext) ArchitecturesList() []string
ArchitecturesList returns list of architectures fixed via command line or config
func (*AptlyContext) Cleanup ¶
func (context *AptlyContext) Cleanup()
Cleanup does partial shutdown of context
func (*AptlyContext) CloseDatabase ¶
func (context *AptlyContext) CloseDatabase() error
CloseDatabase closes the db temporarily
func (*AptlyContext) CollectionFactory ¶
func (context *AptlyContext) CollectionFactory() *deb.CollectionFactory
CollectionFactory builds factory producing all kinds of collections
func (*AptlyContext) Config ¶
func (context *AptlyContext) Config() *utils.ConfigStructure
Config loads and returns current configuration
func (*AptlyContext) DBPath ¶
func (context *AptlyContext) DBPath() string
DBPath builds path to database
func (*AptlyContext) Database ¶
func (context *AptlyContext) Database() (database.Storage, error)
Database opens and returns current instance of database
func (*AptlyContext) DependencyOptions ¶
func (context *AptlyContext) DependencyOptions() int
DependencyOptions calculates options related to dependecy handling
func (*AptlyContext) Downloader ¶
func (context *AptlyContext) Downloader() aptly.Downloader
Downloader returns instance of current downloader
func (*AptlyContext) Flags ¶
func (context *AptlyContext) Flags() *flag.FlagSet
Flags returns current command flags
func (*AptlyContext) GetPublishedStorage ¶
func (context *AptlyContext) GetPublishedStorage(name string) aptly.PublishedStorage
GetPublishedStorage returns instance of PublishedStorage
func (*AptlyContext) GetSigner ¶ added in v1.1.0
func (context *AptlyContext) GetSigner() pgp.Signer
GetSigner returns Signer with respect to provider
func (*AptlyContext) GetVerifier ¶ added in v1.1.0
func (context *AptlyContext) GetVerifier() pgp.Verifier
GetVerifier returns Verifier with respect to provider
func (*AptlyContext) GlobalFlags ¶
func (context *AptlyContext) GlobalFlags() *flag.FlagSet
GlobalFlags returns flags passed to all commands
func (*AptlyContext) LookupOption ¶
func (context *AptlyContext) LookupOption(defaultValue bool, name string) (result bool)
LookupOption checks boolean flag with default (usually config) and command-line setting
func (*AptlyContext) PackagePool ¶
func (context *AptlyContext) PackagePool() aptly.PackagePool
PackagePool returns instance of PackagePool
func (*AptlyContext) Progress ¶
func (context *AptlyContext) Progress() aptly.Progress
Progress creates or returns Progress object
func (*AptlyContext) ReOpenDatabase ¶
func (context *AptlyContext) ReOpenDatabase() error
ReOpenDatabase reopens the db after close
func (*AptlyContext) UpdateFlags ¶
func (context *AptlyContext) UpdateFlags(flags *flag.FlagSet)
UpdateFlags sets internal copy of flags in the context
func (*AptlyContext) UploadPath ¶
func (context *AptlyContext) UploadPath() string
UploadPath builds path to upload storage
type FatalError ¶
FatalError is type for panicking to abort execution with non-zero exit code and print meaningful explanation