Documentation ¶
Overview ¶
Package bridgr downloads artifacts based on a configuration file
Index ¶
- Variables
- func BaseDir(repo string) string
- func PullImage(cli ImagePuller, image reference.Named) error
- func Serve(addr string, root http.FileSystem) error
- type Configuration
- type Credential
- type CredentialReader
- type CredentialReaderWriter
- type CredentialWriter
- type Docker
- type DockerCredential
- type File
- type FileItem
- type Git
- type GitItem
- type Helm
- type ImagePuller
- type Python
- type Ruby
- type WorkerCredentialReader
- type Yum
Constants ¶
This section is empty.
Variables ¶
var ( // Verbose determines whether debug logging is printed Verbose = false // Version is the built version of Bridgr Version = "development" // DryRun holds whether workers should actually retrieve artifacts, or just do setup DryRun = false // FileTimeout is the duration used for HTTP/s file download overall timeout. Used in the transport object FileTimeout = time.Second * 20 )
Functions ¶
func BaseDir ¶
BaseDir gives the runtime absolute directory of the base "packages" directory See the individual repo type struct for the type-specific path
Types ¶
type Configuration ¶
type Configuration interface { Name() string Image() reference.Named Hook() mapstructure.DecodeHookFunc Setup() error Run() error }
Configuration is a type that unifies all of the sub-types of repository configurations It has a Hook function that returns a list of functions used for parsing its types with mapstructure decoding. Image is a configuration that can return a reference to a docker image that should be used for running its worker. This is a type that must be "batch" run in a docker image to create its repository
type Credential ¶
Credential encapsulates a username/password pair
func (*Credential) Base64 ¶
func (c *Credential) Base64() string
Base64 returns a string with the provided Credential content base64 encoded after being joined by ':' (colon character)
func (*Credential) Conjoin ¶
func (c *Credential) Conjoin() string
Conjoin returns a string with the Credential content joined by a ':' (colon character)
func (*Credential) IsValid ¶ added in v1.5.1
func (c *Credential) IsValid() bool
IsValid returns a boolean to indicate that the Credential has at least a Username or a Password
type CredentialReader ¶
type CredentialReader interface {
Read(*url.URL) (Credential, bool)
}
CredentialReader is the interface that wraps a Credential Read method The Reader should get credential information from somewhere (usually the runtime environment), and returns a Credential struct as well as a boolean that indicates whether the reading of credential pieces (ie, Username, Password and/or Token) was successful. Success is not strictly whether the pieces of information were found, but whether they existed in the environment to be read. A Credential struct with empty strings for its fields is still a valid Credential
type CredentialReaderWriter ¶
type CredentialReaderWriter interface { CredentialReader CredentialWriter }
CredentialReaderWriter is an interface that combines both the CredentialReader and CredentialWriter
type CredentialWriter ¶
type CredentialWriter interface {
Write(Credential) error
}
CredentialWriter is the interface wrapping the Write method for Credentials Write may write a credential to any form (string, another struct), and any medium (memory, file, etc).
type Docker ¶
type Docker struct { Destination string `mapstructure:"repository,omitempty"` Images []reference.Named }
Docker struct is the configuration holder for the Docker worker type
func (*Docker) Hook ¶
func (d *Docker) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files
type DockerCredential ¶
type DockerCredential struct { types.AuthConfig WorkerCredentialReader }
DockerCredential implements the CredentialReader and CredentialWriter interface for the Docker "login" format
func (*DockerCredential) String ¶
func (credWriter *DockerCredential) String() string
func (*DockerCredential) Write ¶
func (credWriter *DockerCredential) Write(c Credential) error
type File ¶
type File []*FileItem
File is the implementation for static File repositories
func (*File) Hook ¶
func (f *File) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files
type FileItem ¶
FileItem is a discreet file definition object
type Git ¶
type Git []GitItem
Git is the struct for holding a Git configuration in Bridgr
func (*Git) Hook ¶
func (g *Git) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files
type GitItem ¶
type GitItem struct { URL *url.URL Bare bool Branch plumbing.ReferenceName Tag plumbing.ReferenceName }
GitItem is the sub-struct of items in a Git struct
func NewGitItem ¶
NewGitItem creates a new, default GitItem struct
type Helm ¶ added in v1.5.1
type Helm []*FileItem
Helm is a list of files that represent Helm charts, and have both a source and target
func (*Helm) Hook ¶ added in v1.5.1
func (h *Helm) Hook() mapstructure.DecodeHookFunc
Hook returns a list of DecodeHookFunc objects that are needed to decode a generic object into a Helm struct. It is used with mapstructure library.
func (Helm) Image ¶ added in v1.5.1
Image returns the docker image used for collecting Helm charts in this worker. It is always nil, as the Helm worker doesn't use docker.
type ImagePuller ¶
type ImagePuller interface {
ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)
}
ImagePuller is a simplified interface to docker ImageAPIClient, that only defines the ImagePull function
type Python ¶
type Python struct { Packages []pythonPackage Version pythonVersion Sources []string }
Python is the configuration object specifically for the Python section of the config file
func (*Python) Hook ¶
func (p *Python) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files
type Ruby ¶
type Ruby struct { Gems []rubyItem Version rubyVersion Sources []string }
Ruby struct is the configuration object specifically for the Ruby section of the config file
func (Ruby) Hook ¶
func (r Ruby) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files
type WorkerCredentialReader ¶
type WorkerCredentialReader struct{}
WorkerCredentialReader reads a credential for a URL from the environment variables
func (*WorkerCredentialReader) Read ¶
func (w *WorkerCredentialReader) Read(url *url.URL) (Credential, bool)
type Yum ¶
Yum sets up and creates an YUM repository based on user configuration
func (*Yum) Hook ¶
func (y *Yum) Hook() mapstructure.DecodeHookFunc
Hook implements the Parser interface, returns a function for use by mapstructure when parsing config files