config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplicationConfig = new(ApplicationSettings)
View Source
var WorkspaceConfig = new(WorkspaceSettings)
View Source
var YamlConfig = &Total{
	Settings: Settings{
		Application: ApplicationConfig,
		Workspace:   WorkspaceConfig,
	},
}

Functions

func CheckInSlice

func CheckInSlice(compareTo []string, from string) bool

CheckInSlice check if element is in slice.

func CheckViperErr

func CheckViperErr(err error) error

CheckViperErr give explanation of error and a bool of whether error exists.

func InitConfig added in v0.2.2

func InitConfig(yamlAddr *string)

func LoadConfigFromYaml

func LoadConfigFromYaml(configFile string) (*viper.Viper, error)

LoadConfigFromYaml Returns raw viper object that could be read directly.

func ReleaseYaml

func ReleaseYaml(path string) error

Releaseyaml if no yaml is available; Deprecated in v0.1.3+.

Types

type ApplicationSettings

type ApplicationSettings struct {
	Mode string
	Host string
	Name string
	Port int
}

type Repo

type Repo struct {
	ID          string
	Type        string
	Trigger     []string
	Repoaddr    string
	Branch      string
	Sshkeyaddr  string
	Username    string
	Password    string
	Token       string
	Buildscript string
	//0->Unknown
	//1->Failing
	//2->Waiting
	//3->Passing
	BuildStatus int
}

type Settings

type Settings struct {
	Application *ApplicationSettings `yaml:"application"`
	Workspace   *WorkspaceSettings   `yaml:"workspace"`
}

type Total

type Total struct {
	Settings Settings
}

type WorkspaceSettings

type WorkspaceSettings struct {
	Path string
	Repo []Repo `yaml:"repo"`
}

Jump to

Keyboard shortcuts

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