cfg

package
v0.0.0-...-80a0973 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFile

func LoadFile(fileName string) (bytes []byte, err error)

LoadFile will return a Config from a file (string)

Types

type BlackList

type BlackList struct {
	Pattern string `yaml:"pattern"`
}

type Config

type Config struct {
	DockerRegistries []DockerRegistry `yaml:"dockerRegistries"`
	GitRepos         []GitRepo        `yaml:"git"`
	Global           Global           `yaml:"global"`
}

Config is the top level of config

func ParseConfig

func ParseConfig(data []byte) (Config, error)

ParseConfig will read a config and infer some defaults if they're omitted (one day)

type DockerRegistry

type DockerRegistry struct {
	Reg     string `yaml:"reg"`
	Name    string `yaml:"name"`
	TimeOut int    `yaml:"timeOut,omitempty"`
}

DockerRegistry contains info about the docker registries

type Files

type Files struct {
	Path string `yaml:"path"`
}

Files to operate upon in a git repo

type GitRepo

type GitRepo struct {
	URL               string    `yaml:"url"`
	Branch            string    `yaml:"branch"`
	Key               string    `yaml:"key"`
	PollFreq          int       `yaml:"pollFreq"`
	Name              string    `yaml:"name"`
	RemoteConfig      bool      `yaml:"remoteConfig"` // propagate []Updates from remote git ".laminar.yaml" ?
	Updates           []Updates `yaml:"updates,omitempty"`
	PreCommitCommands []string  `yaml:"preCommitCommands,omitempty"`
}

GitRepo which laminar operates on

type Global

type Global struct {
	// NOTE: when adding 'default' fields here please update TestParseConfigFailure in config_test.go
	GitUser     string      `yaml:"gitUser"`
	GitEmail    string      `yaml:"gitEmail"`
	GitMessage  interface{} `yaml:"gitMessage"`
	GitHubToken string      `yaml:"gitHubToken"` // allow inbound webhooks from GitHub
	WebAddress  string      `yaml:"webAddress" default:":8080"`
	WebDebug    bool        `yaml:"webDebug" default:"false"`
}

Global settings such as git commit user/email

type RemoteUpdates

type RemoteUpdates struct {
	Updates []Updates `yaml:"updates"`
}

func GetUpdatesFromGit

func GetUpdatesFromGit(path string) (updates RemoteUpdates, err error)

GetUpdatesFromGit will check for a .laminar.yaml in the top level of a git repo and attempt to return []Updates from there

func ParseUpdates

func ParseUpdates(data []byte) (RemoteUpdates, error)

ParseUpdates will read the .laminar.yaml from a repo and return its RemoteUpdates

type Updates

type Updates struct {
	PatternString string      `yaml:"pattern"`
	Files         []Files     `yaml:"files"`
	BlackList     []BlackList `yaml:"blacklist"`
}

Updates contains instructions about what to do with matching image

Jump to

Keyboard shortcuts

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