internal

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package internal provides a collection of internal packages used for the Vela CLI actions.

More information:

Usage:

import "github.com/go-vela/cli/internal"

Index

Constants

View Source
const (
	// FlagAPIAddress defines the key for the
	// flag when setting the API address.
	FlagAPIAddress = "api.addr"

	// FlagAPIToken defines the key for the
	// flag when setting the API token.
	FlagAPIToken = "api.token"

	// FlagAPIAccessToken defines the key for
	// the flag when setting the API access token.
	FlagAPIAccessToken = "api.token.access"

	// FlagAPIRefreshToken defines the key for
	// for the flag when setting the API
	// refresh token.
	//nolint:gosec // false negative - not a real token
	FlagAPIRefreshToken = "api.token.refresh"

	// FlagAPIVersion defines the key for the
	// flag when setting the API version.
	FlagAPIVersion = "api.version"
)

API flag keys.

View Source
const (
	// FlagCompilerGitHubToken defines the key for the
	// flag when setting the compiler github token.
	//nolint:gosec // ignoring since this is a constant for a user passed token
	FlagCompilerGitHubToken = "compiler.github.token"

	// FlagCompilerGitHubURL defines the key for the
	// flag when setting the compiler github url.
	FlagCompilerGitHubURL = "compiler.github.url"
)

compiler flag keys.

View Source
const (
	// FlagConfig defines the key for the
	// flag when setting the config.
	FlagConfig = "config"

	// FlagOutput defines the key for the
	// flag when setting the output.
	FlagOutput = "output"
)

generic flag keys.

View Source
const (
	// FlagBefore defines the key for the
	// flag when setting the "before" time constraint.
	FlagBefore = "before"

	// FlagAfter defines the key for the
	// flag when setting the "after" time constraint.
	FlagAfter = "after"
)

time constraint flag keys.

View Source
const (
	// FlagPage defines the key for the
	// flag when setting the page.
	FlagPage = "page"

	// FlagPerPage defines the key for the
	// flag when setting the results per page.
	FlagPerPage = "per.page"
)

pagination flag keys.

View Source
const (
	// FlagOrg defines the key for the
	// flag when setting the org.
	FlagOrg = "org"

	// FlagRepo defines the key for the
	// flag when setting the repo.
	FlagRepo = "repo"
)

repository flag keys.

View Source
const (
	// FlagSchedule defines the key for the
	// flag when setting the schedule.
	FlagSchedule = "schedule"

	// FlagBranch defines the key for the
	// flag when setting the branch.
	FlagBranch = "branch"
)

schedule flag keys.

View Source
const (
	// FlagSecretEngine defines the key for the
	// flag when setting the secret engine.
	FlagSecretEngine = "secret.engine"

	// FlagSecretType defines the key for the
	// flag when setting the secret type.
	FlagSecretType = "secret.type"
)

secret flag keys.

View Source
const (
	// FlagWorkerAddress defines the key for the
	// flag when setting the worker address.
	FlagWorkerAddress = "worker.address"

	// FlagWorkerHostname defines the key for the
	// flag when setting the worker hostname.
	FlagWorkerHostname = "worker.hostname"

	// FlagWorkerRegistrationToken defines the key for the
	// flag when viewing the worker registration token.
	FlagWorkerRegistrationToken = "worker.registration.token"
)

worker flag keys.

View Source
const (
	// ActionAdd defines the action for creating a resource.
	ActionAdd = "add"

	// ActionCancel defines the action for canceling of a resource.
	ActionCancel = "cancel"

	// ActionChown defines the action for changing ownership of a resource.
	ActionChown = "chown"

	// ActionCompile defines the action for compiling a resource.
	ActionCompile = "compile"

	// ActionExec defines the action for executing a resource.
	ActionExec = "exec"

	// ActionExpand defines the action for expanding a resource.
	ActionExpand = "expand"

	// ActionGenerate defines the action for producing a resource.
	ActionGenerate = "generate"

	// ActionGet defines the action for getting a list of resources.
	ActionGet = "get"

	// ActionLoad defines the action for loading a resource.
	ActionLoad = "load"

	// ActionRemove defines the action for deleting a resource.
	ActionRemove = "remove"

	// ActionRepair defines the action for repairing a resource.
	ActionRepair = "repair"

	// ActionRestart defines the action for restarting a resource.
	ActionRestart = "restart"

	// ActionSync defines the action for syncing a resource with SCM.
	ActionSync = "sync"

	// ActionSyncAll defines the action for syncing all org resources with SCM.
	ActionSyncAll = "syncAll"

	// ActionUpdate defines the action for modifying a resource.
	ActionUpdate = "update"

	// ActionValidate defines the action for validating a resource.
	ActionValidate = "validate"

	// ActionView defines the action for inspecting a resource.
	ActionView = "view"
)

list of defined CLI actions.

View Source
const (
	// FlagBuild defines the key for the
	// flag when setting the build.
	FlagBuild = "build"
)

build flag keys.

View Source
const (
	// FlagLogLevel defines the key for the
	// flag when setting the log level.
	FlagLogLevel = "log.level"
)

log flag keys.

View Source
const (
	// FlagNoGit defines the key for the
	// flag when setting the no-git status.
	FlagNoGit = "no-git"
)

no git flag keys.

View Source
const (
	// FlagService defines the key for the
	// flag when setting the service.
	FlagService = "service"
)

service flag keys.

View Source
const (
	// FlagStep defines the key for the
	// flag when setting the step.
	FlagStep = "step"
)

step flag keys.

Variables

This section is empty.

Functions

func GetGitConfigOrg added in v0.12.0

func GetGitConfigOrg(path string) string

GetGitConfigOrg opens the git repository, fetches the remote origin url, and parses the url to find the org of the current working directory.

func GetGitConfigRepo added in v0.12.0

func GetGitConfigRepo(path string) string

GetGitConfigRepo opens the git repository, fetches the remote origin url, and parses the url to find the repo of the current working directory.

func ProcessArgs added in v0.13.0

func ProcessArgs(c *cli.Context, resource string, expect string) error

ProcessArgs attempts to get the command line arguments, grab the first value, and set the resource to that value in the context.

func SetGitConfigContext added in v0.12.0

func SetGitConfigContext(c *cli.Context)

SetGitConfigContext attempts to set the org and repo based on the .git/ directory, provided the user has the config flag of no-git set to true.

Types

This section is empty.

Directories

Path Synopsis
Package client provides the ability for Vela to parse and manage the client rendered for a CLI action.
Package client provides the ability for Vela to parse and manage the client rendered for a CLI action.
Package output provides the ability for Vela to manage and manipulate the output rendered for a CLI action.
Package output provides the ability for Vela to manage and manipulate the output rendered for a CLI action.

Jump to

Keyboard shortcuts

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