cfg

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2018 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name  string `toml:"name" comment:"name of the application"`
	Build Build  `toml:"Build"`
}

App stores an application configuration.

func AppFromFile

func AppFromFile(path string) (*App, error)

AppFromFile reads a application configuration file and returns it. If the buildCmd is not set in the App configuration it's set to defaultBuild.Command

func ExampleApp

func ExampleApp(name string) *App

ExampleApp returns an exemplary app cfg struct with the name set to the given value

func (*App) ToFile

func (a *App) ToFile(filepath string) error

ToFile writes an exemplary Application configuration file to filepath. The name setting is set to appName

func (*App) Validate

func (a *App) Validate() error

Validate validates a App configuration

type Build

type Build struct {
	Command string      `toml:"command" commented:"true" comment:"command to build the application, overwrites the parameter in the repository config"`
	Input   BuildInput  `comment:"specifies the inputs for an build, an input is everything that affects the build output"`
	Output  BuildOutput `comment:"specifies the outputs that the application build produces"`
}

Build the build section

func (*Build) Validate

func (b *Build) Validate() error

Validate validates the build section

type BuildInput

type BuildInput struct {
	Files         FileInputs          `comment:"file paths, e.g: source files, the used compiler binary "`
	GitFiles      GitFileInputs       `comment:"If the baur repository is part of a git repository, this option can be used to specify source files tracked by git."`
	GolangSources GolangSources       `` /* 161-byte string literal not displayed */
	DockerImage   []*DockerImageInput `comment:"docker images that are used to build the application or affect in other ways the produces artifact"`
}

BuildInput contains information about inputs (sources, compiler, docker images) for an build

func (*BuildInput) Validate

func (b *BuildInput) Validate() error

Validate validates the BuildInput section

type BuildOutput

type BuildOutput struct {
	File        []*FileOutput        `comment:"a file that is produces by the build"`
	DockerImage []*DockerImageOutput `comment:"a docker image that is produced by the build"`
}

BuildOutput the build output section

func (*BuildOutput) Validate

func (b *BuildOutput) Validate() error

Validate validates the BuildOutput section

type Database

type Database struct {
	PGSQLURL string `` /* 181-byte string literal not displayed */
}

Database contains database configuration

func (*Database) Validate

func (d *Database) Validate() error

Validate validates the Database section of a repository config file

type Discover

type Discover struct {
	Dirs        []string `toml:"application_dirs" comment:"list of directories containing applications, example: ['go/code', 'shop/']"`
	SearchDepth int      `toml:"search_depth" comment:"specifies the max. directory the application search recurses into subdirectories"`
}

Discover stores the Discover section of the repository configuration.

func (*Discover) Validate

func (d *Discover) Validate() error

Validate validates the Discover section and sets defaults.

type DockerImageInput

type DockerImageInput struct {
	Repository string `toml:"repository" comment:"name of the docker repository" commented:"true"`
	Digest     string `toml:"digest" comment:"the digest of the image" commented:"true"`
}

DockerImageInput specifies a docker image as build source

func (*DockerImageInput) IsEmpty

func (d *DockerImageInput) IsEmpty() bool

IsEmpty returns true if DockerImageInput is empty

func (*DockerImageInput) Validate

func (d *DockerImageInput) Validate() error

Validate validates a [DockerImageInput] section

type DockerImageOutput

type DockerImageOutput struct {
	IDFile         string                    `` /* 145-byte string literal not displayed */
	RegistryUpload DockerImageRegistryUpload `comment:"specifies where the image is uploaded to"`
}

DockerImageOutput describes where a docker container is uploaded to

func (*DockerImageOutput) IsEmpty

func (d *DockerImageOutput) IsEmpty() bool

IsEmpty returns true if DockerImageInput is empty

func (*DockerImageOutput) Validate

func (d *DockerImageOutput) Validate() error

Validate validates its content

type DockerImageRegistryUpload

type DockerImageRegistryUpload struct {
	Repository string `toml:"repository" comment:"name of the docker repository" commented:"true"`
	Tag        string `toml:"tag" comment:"tag that is applied to the image, valid variables: $APPNAME, $UUID, $GITCOMMIT"  commented:"true"`
}

DockerImageRegistryUpload holds information about where the docker image should be uploaded to

func (*DockerImageRegistryUpload) IsEmpty

func (d *DockerImageRegistryUpload) IsEmpty() bool

IsEmpty returns true if the struct is empty

func (*DockerImageRegistryUpload) Validate

func (d *DockerImageRegistryUpload) Validate() error

Validate validates its content

type FileInputs

type FileInputs struct {
	Paths []string `` /* 179-byte string literal not displayed */
}

FileInputs describes a file source

func (*FileInputs) Validate

func (f *FileInputs) Validate() error

Validate validates a [[Sources.Files]] section

type FileOutput

type FileOutput struct {
	Path     string   `toml:"path" comment:"path of the artifact" commented:"true"`
	S3Upload S3Upload `comment:"defines an S3 location that the file is uploaded to"`
}

FileOutput describes where a file artifact should be uploaded to

func (*FileOutput) IsEmpty

func (f *FileOutput) IsEmpty() bool

IsEmpty returns true if FileOutput is empty

func (*FileOutput) Validate

func (f *FileOutput) Validate() error

Validate validates a [[Build.Output.File]] section

type GitFileInputs

type GitFileInputs struct {
	// TODO: improve description
	Paths []string `` /* 340-byte string literal not displayed */
}

GitFileInputs describes source files that are in the git repository by git pathnames

type GolangSources

type GolangSources struct {
	Paths  []string `toml:"paths" comment:"paths to directories containing Golang source files" commented:"true"`
	GoPath string   `` /* 205-byte string literal not displayed */
}

GolangSources specifies inputs for Golang Applications

func (*GolangSources) Validate

func (g *GolangSources) Validate() error

Validate validates the GolangSources section

type Repository

type Repository struct {
	Discover    Discover        `comment:"application discovery settings"`
	Build       RepositoryBuild `comment:"build configuration"`
	BaurVersion string          `toml:"baur_version" comment:"version of baur"`
	Database    Database        `toml:"Database" comment:"configures the database in which build informations are stored" commented:"true"`
}

Repository contains the repository configuration.

func ExampleRepository

func ExampleRepository() *Repository

ExampleRepository returns an exemplary Repository config

func RepositoryFromFile

func RepositoryFromFile(cfgPath string) (*Repository, error)

RepositoryFromFile reads the repository config from a file and returns it.

func (*Repository) ToFile

func (r *Repository) ToFile(filepath string, overwrite bool) error

ToFile writes an Repository configuration file to filepath. If overwrite is true an existent file will be overwriten. If it's false the function returns an error if the file exist.

func (*Repository) Validate

func (r *Repository) Validate() error

Validate validates a repository configuration

type RepositoryBuild

type RepositoryBuild struct {
	BuildCmd string `toml:"build_command" comment:"command to build the application, can be overwritten in the application config files"`
}

RepositoryBuild contains the build section of the repository

func (*RepositoryBuild) Validate

func (b *RepositoryBuild) Validate() error

Validate validates the Build section of a repository config file

type S3Upload

type S3Upload struct {
	Bucket   string `toml:"bucket" comment:"S3 bucket name" commented:"true"`
	DestFile string `` /* 133-byte string literal not displayed */
}

S3Upload contains S3 upload information

func (*S3Upload) IsEmpty

func (s *S3Upload) IsEmpty() bool

IsEmpty returns true if S3Upload is empty

func (*S3Upload) Validate

func (s *S3Upload) Validate() error

Validate validates a [[Build.Output.File]] section

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL