config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFormatNotSupportedError = errors.New("unknown setting format")
	ConfigContentError            = errors.New("yaml Error-Check your yaml content")
)
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 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
}

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