Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvGithubToken Name of environment variable for github token
	EnvGithubToken = "GITHUB_TOKEN"
	// EnvPullRequestID Name of environment variable for pull request url
	EnvPullRequestID = "CIRCLE_PULL_REQUEST"
	// EnvRepoName Name of environment variable for GitHub repo
	EnvRepoName = "CIRCLE_PROJECT_REPONAME"
	// EnvRepoOwner Name of environment variable for GitHub owner
	EnvRepoOwner = "CIRCLE_PROJECT_USERNAME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	LogFile       string
	TagID         string
	RepoName      string
	RepoOwner     string
	GithubToken   string
	PullRequest   int
	DeleteComment bool
}

AppConfig application configuration initialized by cobra arguments or environment variabels

func (*AppConfig) Init

func (a *AppConfig) Init() error

Init will create default AppConfig with following priority 1. Environment Variables GITHUB_TOKEN, CIRCLE_PULL_REQUEST, CIRCLE_PROJECT_REPONAME, CIRCLE_PROJECT_USERNAME 2. CLI args returns ValidationError if required field where not set

type ValidationError added in v1.1.2

type ValidationError struct {
	CliArg string
	EnvVar string
}

ValidationError indicated a missing configuration either CLI argument or environment variable

func (*ValidationError) Error added in v1.1.2

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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