Documentation ¶
Overview ¶
Configuration
The RepositoryConfig object provides some basic metadata used to generate repositories in addition to information about every repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobOptions ¶
type JobOptions struct { Configuration *RepositoryConfig `bson:"conf" json:"conf" yaml:"conf"` Distro *RepositoryDefinition `bson:"distro" json:"distro" yaml:"distro"` Version string `bson:"version" json:"version" yaml:"version"` Arch string `bson:"arch" json:"arch" yaml:"arch"` Packages []string `bson:"packages" json:"packages" yaml:"packages"` JobID string `bson:"job_id" json:"job_id" yaml:"job_id"` AWSProfile string `bson:"aws_profile" json:"aws_profile" yaml:"aws_profile"` AWSKey string `bson:"aws_key" json:"aws_key" yaml:"aws_key"` AWSSecret string `bson:"aws_secret" json:"aws_secret" yaml:"aws_secret"` AWSToken string `bson:"aws_token" json:"aws_token" yaml:"aws_token"` NotaryKey string `bson:"notary_key" json:"notary_key" yaml:"notary_key"` NotaryToken string `bson:"notary_token" json:"notary_token" yaml:"notary_token"` // contains filtered or unexported fields }
JobOptions describes the options to run a job that builds a repo.
func (*JobOptions) Validate ¶
func (opts *JobOptions) Validate() error
Validate returns an error if the job options struct is not logically valid.
type RepoType ¶
type RepoType string
RepoType defines type of repositories.
const ( // RPM is a constant to refer to RPM repositories. RPM RepoType = "rpm" // DEB is a constant to refer to DEB repositories. DEB = "deb" )
type RepositoryConfig ¶
type RepositoryConfig struct { Repos []*RepositoryDefinition `bson:"repos" json:"repos" yaml:"repos"` Services struct { NotaryURL string `bson:"notary_url" json:"notary_url" yaml:"notary_url"` } `bson:"services" json:"services" yaml:"services"` Templates struct { Index string `bson:"index_page" json:"index_page" yaml:"index_page"` Deb map[string]string `bson:"deb" json:"deb" yaml:"deb"` } `bson:"templates" json:"templates" yaml:"templates"` DryRun bool `bson:"dry_run" json:"dry_run" yaml:"dry_run"` Verbose bool `bson:"verbose" json:"verbose" yaml:"verbose"` WorkSpace string `bson:"workspace" json:"workspace" yaml:"workspace"` TempSpace string `bson:"temp" json:"temp" yaml:"temp"` Region string `bson:"region" json:"region" yaml:"region"` // contains filtered or unexported fields }
RepositoryConfig provides an interface and schema for the repository configuration file. These files contain some basic global configuration, and a list of repositories, controlled by the RepositoryDefinition type.
func GetConfig ¶
func GetConfig(fileName string) (*RepositoryConfig, error)
GetConfig takes the name of a file and returns a pointer to RepositoryConfig object. If the object is invalid or currupt in some way, the method returns a nil RepositoryConfig and an error.
func NewRepositoryConfig ¶
func NewRepositoryConfig() *RepositoryConfig
NewRepositoryConfig produces a pointer to an initialized RepositoryConfig object.
func (*RepositoryConfig) GetRepositoryDefinition ¶
func (c *RepositoryConfig) GetRepositoryDefinition(name, edition string) (*RepositoryDefinition, bool)
GetRepositoryDefinition takes the name of as repository and an edition, return a repository configuration. The second value is true when the requested edition+name exists, and false otherwise. When the requested edition+name does not exist, the value is nil.
func (*RepositoryConfig) Validate ¶
func (c *RepositoryConfig) Validate() error
Validate ensures that the configuration file is correct, sets any unset defaults, and returns an error if there are any remaining errors.
type RepositoryDefinition ¶
type RepositoryDefinition struct { Name string `bson:"name" json:"name" yaml:"name"` Type RepoType `bson:"type" json:"type" yaml:"type"` CodeName string `bson:"code_name" json:"code_name" yaml:"code_name"` Bucket string `bson:"bucket" json:"bucket" yaml:"bucket"` Region string `bson:"region" json:"region" yaml:"region"` Repos []string `bson:"repos" json:"repos" yaml:"repos"` Edition string `bson:"edition" json:"edition" yaml:"edition"` Architectures []string `bson:"architectures,omitempty" json:"architectures,omitempty" yaml:"architectures,omitempty"` Component string `bson:"component" json:"component" yaml:"component"` }
RepositoryDefinition objects exist for each repository that we want to publish