model

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionUnspecified        = "ACTION_UNSPECIFIED"
	ActionBeforeDownload     = "BEFORE_DOWNLOAD"
	ActionAfterDownload      = "AFTER_DOWNLOAD"
	ActionBeforeUpload       = "BEFORE_UPLOAD"
	ActionAfterCreate        = "AFTER_CREATE"
	ActionAfterBuildInfoSave = "AFTER_BUILD_INFO_SAVE"
	ActionAfterMove          = "AFTER_MOVE"
	ActionGenericEvent       = "GENERIC_EVENT"
	ActionBeforeCreateToken  = "BEFORE_CREATE_TOKEN"
)
View Source
const (
	FlagForce      = "force"
	FlagNoTest     = "no-test"
	FlagEdit       = "edit"
	FlagNoSecrets  = "no-secrets"
	FlagJsonOutput = "json"
	FlagTimeout    = "timeout-ms"
)

Variables

View Source
var (
	EnvKeyServerUrl       = "JFROG_WORKER_CLI_DEV_SERVER_URL"
	EnvKeyAccessToken     = "JFROG_WORKER_CLI_DEV_ACCESS_TOKEN"
	EnvKeySecretsPassword = "JFROG_WORKER_CLI_DEV_SECRETS_PASSWORD"
	EnvKeyAddSecretValue  = "JFROG_WORKER_CLI_DEV_ADD_SECRET_VALUE"
)

Functions

func ActionIsValid

func ActionIsValid(actionName string) bool

func ActionNames

func ActionNames() string

func ActionNeedsCriteria

func ActionNeedsCriteria(actionName string) bool

func DecryptSecret

func DecryptSecret(password string, encryptedValue string) (string, error)

func EncryptSecret

func EncryptSecret(password string, secretValue string) (string, error)

func GetJsonOutputFlag

func GetJsonOutputFlag(description ...string) components.BoolFlag

func GetJsonPayloadArgument

func GetJsonPayloadArgument() components.Argument

func GetNoSecretsFlag

func GetNoSecretsFlag(description ...string) components.BoolFlag

func GetNoTestFlag

func GetNoTestFlag(description ...string) components.BoolFlag

func GetServerDetails

func GetServerDetails(c *components.Context) (*config.ServerDetails, error)

func GetTimeoutFlag

func GetTimeoutFlag() components.StringFlag

func GetTimeoutParameter

func GetTimeoutParameter(c intFlagProvider) (time.Duration, error)

func GetWorkerKeyArgument

func GetWorkerKeyArgument() components.Argument

func ReadSecretPassword

func ReadSecretPassword(prompt ...string) (string, error)

Types

type ArtifactFilterCriteria

type ArtifactFilterCriteria struct {
	RepoKeys []string `json:"repoKeys,omitempty"`
}

type FilterCriteria

type FilterCriteria struct {
	ArtifactFilterCriteria ArtifactFilterCriteria `json:"artifactFilterCriteria,omitempty"`
}

type Manifest

type Manifest struct {
	Name           string         `json:"name"`
	Description    string         `json:"description"`
	SourceCodePath string         `json:"sourceCodePath"`
	Action         string         `json:"action"`
	Enabled        bool           `json:"enabled"`
	Secrets        Secrets        `json:"secrets"`
	FilterCriteria FilterCriteria `json:"filterCriteria,omitempty"`
}

func ReadManifest

func ReadManifest(dir ...string) (*Manifest, error)

ReadManifest reads a manifest from the working directory or from the directory provided as argument.

func (*Manifest) DecryptSecrets

func (mf *Manifest) DecryptSecrets(withPassword ...string) error

func (*Manifest) ReadSourceCode

func (mf *Manifest) ReadSourceCode() (string, error)

ReadSourceCode reads the content of the file pointed by SourceCodePath

func (*Manifest) Save

func (mf *Manifest) Save(dir ...string) error

func (*Manifest) Validate

func (mf *Manifest) Validate() error

type Secret

type Secret struct {
	Key              string `json:"key"`
	Value            string `json:"value"`
	MarkedForRemoval bool   `json:"markedForRemoval"`
}

type Secrets

type Secrets map[string]string

type WorkerDetails

type WorkerDetails struct {
	Key            string         `json:"key"`
	Description    string         `json:"description"`
	Enabled        bool           `json:"enabled"`
	SourceCode     string         `json:"sourceCode"`
	Action         string         `json:"action"`
	FilterCriteria FilterCriteria `json:"filterCriteria,omitempty"`
	Secrets        []*Secret      `json:"secrets"`
}

Jump to

Keyboard shortcuts

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