config

package
v0.0.0-...-5cb3060 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessLevelDeveloper  = "developer"
	AccessLevelMaintainer = "maintainer"
)

GitLab AccessLevel string aliases used in the config

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLevel

type AccessLevel string

AccessLevel wraps the numeric gitlab access level into a readable string

func (AccessLevel) Value

func (a AccessLevel) Value() *gitlab.AccessLevelValue

Value returns the gitlab numeric value of the access level

type ComplianceSettings

type ComplianceSettings struct {
	Email     EmailConfig                       `json:"email"`
	Mandatory map[string]map[string]interface{} `json:"mandatory"`
}

ComplianceSettings defines what is displayed and mandatory settings.

type Config

type Config struct {
	GroupName           string `json:"group_name"`
	CreateDefaultBranch bool   `json:"create_default_branch"`
	Error               bool
	ProjectBlacklist    []string          `json:"project_blacklist"`
	ProjectWhitelist    []string          `json:"project_whitelist"`
	ProtectedBranches   []ProtectedBranch `json:"protected_branches"`

	ApprovalSettings *gitlab.ChangeApprovalConfigurationOptions `json:"approval_settings"`
	ProjectSettings  *gitlab.EditProjectOptions                 `json:"project_settings"`
	Compliance       *ComplianceSettings                        `json:"compliance"`
}

Config stores the root group name and some additional configuration values settings documented at https://godoc.org/github.com/xanzy/go-gitlab#CreateProjectOptions

func Parse

func Parse(configFilePath string) (*Config, error)

Parse takes the given configFilePath and reads the containing config file into a config struct

type EmailConfig

type EmailConfig struct {
	From   string
	Port   int
	Server string
	To     []string
}

EmailConfig

type ProtectedBranch

type ProtectedBranch struct {
	Name             string      `json:"name"`
	PushAccessLevel  AccessLevel `json:"push_access_level"`
	MergeAccessLevel AccessLevel `json:"merge_access_level"`
}

ProtectedBranch defines who can act on a protected branch

Jump to

Keyboard shortcuts

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