config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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)

InitConfig loads config from yaml.

func LoadConfigFromYaml

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

LoadConfigFromYaml Returns raw viper object that could be read directly.

Types

type ApplicationSettings

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

type BuildInfo added in v0.3.1

type BuildInfo struct {
	RepoID      string
	CreatedAt   time.Time
	BuildStatus int
	Output      string
	TimeCost    int64
}

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 TriggerInfo added in v0.3.1

type TriggerInfo struct {
	RepoID            string
	IsAvailableAction uint8
	Action            string
	Branch            string
	HookType          string
	CreatedAt         time.Time
	TriggerBy         string
	HashBeforeTrigger string
	HashAfterTrigger  string
}

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