config

package
v0.9.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 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 Config

type Config struct {
	Action       string
	File         string
	Addr         string
	Token        string
	AccessToken  string
	RefreshToken string
	Version      string
	LogLevel     string
	Org          string
	Repo         string
	Engine       string
	Type         string
	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.

nolint: funlen,gocyclo // ignore cyclomatic complexity and function length

func (*Config) Remove

func (c *Config) Remove() error

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

nolint: funlen // ignore function length due to comments and conditionals

func (*Config) Update

func (c *Config) Update() error

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

nolint: funlen // ignore function length due to comments and conditionals

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"`
	Secret *Secret `yaml:"secret,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.

nolint: golint // ignore studder for package and struct name

func (*ConfigFile) Empty

func (c *ConfigFile) Empty() bool

Empty checks if the config file contains empty values.

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