config

package
v0.23.3 Latest Latest
Warning

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

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

Documentation

Overview

Package config provides the defined CLI config actions for Vela.

Usage:

import "github.com/go-vela/cli/action/config"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Address      string `yaml:"addr,omitempty"`
	Token        string `yaml:"token,omitempty"`
	AccessToken  string `yaml:"access_token,omitempty"`
	RefreshToken string `yaml:"refresh_token,omitempty"`
	Version      string `yaml:"version,omitempty"`
}

API represents the API related configuration fields populated in the config file to perform requests with Vela.

type Compiler added in v0.10.0

type Compiler struct {
	GitHub *GitHub `yaml:"github,omitempty"`
}

Compiler represents the compiler configuration fields populated in the config file to perform requests with Vela.

type Config

type Config struct {
	Action       string
	File         string
	Addr         string
	Token        string
	AccessToken  string
	RefreshToken string
	Version      string
	LogLevel     string
	NoGit        string
	Org          string
	Repo         string
	Engine       string
	Type         string
	GitHub       *GitHub
	UpdateFlags  map[string]string
	RemoveFlags  []string
	Output       string
}

Config represents the configuration necessary to perform config related quests with Vela.

func (*Config) Generate

func (c *Config) Generate() error

Generate produces a config file based off the provided configuration.

func (*Config) Load

func (c *Config) Load(ctx *cli.Context) error

Load reads the config file and sets the values based off the provided configuration.

func (*Config) Remove

func (c *Config) Remove() error

Remove deletes one or more fields from the config file based off the provided configuration.

func (*Config) Update

func (c *Config) Update() error

Update modifies one or more fields from the config file based off the provided configuration.

func (*Config) Validate

func (c *Config) Validate() error

Validate verifies the configuration provided.

func (*Config) View

func (c *Config) View() error

View inspects the config file based off the provided configuration.

type ConfigFile

type ConfigFile struct {
	API      *API      `yaml:"api,omitempty"`
	Log      *Log      `yaml:"log,omitempty"`
	NoGit    string    `yaml:"no-git,omitempty"`
	Secret   *Secret   `yaml:"secret,omitempty"`
	Compiler *Compiler `yaml:"compiler,omitempty"`
	Output   string    `yaml:"output,omitempty"`
	Org      string    `yaml:"org,omitempty"`
	Repo     string    `yaml:"repo,omitempty"`
}

ConfigFile represents the configuration file to perform config related requests with Vela.

func (*ConfigFile) Empty

func (c *ConfigFile) Empty() bool

Empty checks if the config file contains empty values.

type GitHub added in v0.10.0

type GitHub struct {
	Token string `yaml:"token,omitempty"`
	URL   string `yaml:"url,omitempty"`
}

GitHub represents the compiler configuration fields populated in the config file to perform requests with Vela.

type Log

type Log struct {
	Level string `yaml:"level,omitempty"`
}

Log represents the log related configuration fields populated in the config file to perform requests with Vela.

type Secret

type Secret struct {
	Engine string `yaml:"engine,omitempty"`
	Type   string `yaml:"type,omitempty"`
}

Secret represents the secret configuration fields populated in the config file to perform requests with Vela.

Jump to

Keyboard shortcuts

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