Documentation
¶
Overview ¶
Package config provides configuration management for batch-tool.
Index ¶
- Constants
- Variables
- func Cancel(ctx context.Context) context.CancelFunc
- func Child(ctx context.Context) *viper.Viper
- func Init(ctx context.Context) context.Context
- func New() *viper.Viper
- func SetChild(ctx context.Context) context.Context
- func SetViper(ctx context.Context, v *viper.Viper) context.Context
- func Viper(ctx context.Context) *viper.Viper
- func WithCancel(ctx context.Context) (context.Context, context.CancelFunc)
Constants ¶
View Source
const ( EnvGopath = "gopath" GitUser = "git.user" GitHost = "git.host" GitProject = "git.project" GitProjects = "git.projects" GitProvider = "git.provider" GitDirectory = "git.directory" DefaultBranch = "git.default-branch" StashUpdates = "git.stash-updates" DefaultMergeMethod = "git.default-merge-method" // CloneSSHURLTmpl is the SSH URL template with placeholders: User, Host, Project, Repo CloneSSHURLTmpl = "ssh://%s@%s/%s/%s.git" SortRepos = "repos.sort" RepoAliases = "repos.aliases" UnwantedLabels = "repos.unwanted-labels" SkipArchived = "repos.skip-archived" SkipUnwanted = "repos.skip-unwanted" SuperSetLabel = "repos.catch-all" DefaultReviewers = "repos.reviewers" DefaultTeamReviewers = "repos.team-reviewers" CatalogCachePath = "repos.cache.path" CatalogCacheTTL = "repos.cache.ttl" Branch = "branch" AuthToken = "auth-token" TokenLabel = "repos.tokens.label" TokenSkip = "repos.tokens.skip" TokenForced = "repos.tokens.forced" OutputStyle = "channels.output-style" PrintResults = "channels.print-results" WaitOnExit = "channels.wait-on-exit" ChannelBuffer = "channels.buffer-size" MaxConcurrency = "channels.max-concurrency" WriteBackoff = "channels.write-backoff" GithubHourlyWriteLimit = "github.hourly-write-limit" GithubBackoffSmall = "github.write-backoff-small" GithubBackoffLarge = "github.write-backoff-large" // == COMMAND FLAGS == // CmdEnv = "cmd.args.env" // git GitCommitMessage = "git.args.commit.message" GitCommitAmend = "git.args.commit.amend" GitCommitPush = "git.args.commit.push" GitPushForce = "git.args.push.force" GitStashAllowAny = "git.args.stash.allow-any" // pr PrOptions = "pr.args.options" PrTitle = "pr.args.title" PrDescription = "pr.args.description" PrDraft = "pr.args.draft" PrReviewers = "pr.args.reviewers" PrTeamReviewers = "pr.args.team-reviewers" PrResetReviewers = "pr.args.reset-reviewers" PrBaseBranch = "pr.args.base-branch" PrMergeCheck = "pr.args.merge-check" PrMergeMethod = "pr.args.merge-method" // make MakeTargets = "make.args.targets" )
Variables ¶
View Source
var ( // CfgFile specifies the configuration file path CfgFile string // Version is dynamically set at build time using the -X linker flag. // Default value is used for testing and development builds. Version = "dev" )
Functions ¶
func Cancel ¶
func Cancel(ctx context.Context) context.CancelFunc
Cancel returns the cancel function attached to ctx by WithCancel, or a no-op if none is present.
func Child ¶ added in v0.11.0
Child creates a new Viper instance that inherits all settings from the parent context.
func SetChild ¶ added in v0.11.0
SetChild creates a child Viper instance and saves it into the context.
func WithCancel ¶
WithCancel returns a copy of ctx with a new cancel function attached as a context value. The returned cancel function should be deferred by the caller. Other packages can retrieve the same cancel function via Cancel(ctx).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.