config

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultStateHistoryLimit   = 10
	DefaultBackupRevisionLimit = 10
)

Variables

View Source
var (
	DefaultConfigPath = filepath.Join(xdg.ConfigHome, "kontext", "kontext.yaml")
)

Functions

This section is empty.

Types

type Backup added in v1.1.0

type Backup struct {
	// enable/disable the backup, defaults to true
	Enabled bool `json:"enabled"`
	// set the backup directory
	Directory string `json:"directory,omitempty"`
	// set the maximum backup revision count
	Revisions int `json:"revisions,omitempty"`
}

Backup configuration options

type Client added in v1.2.0

type Client struct {
	// File of the file, that will be used to read the configuration
	File string
}

func (*Client) Read added in v1.2.0

func (r *Client) Read() (*Config, error)

Read reads the current config file and serialize it with koanf

type Config

type Config struct {
	Global Global `json:"global,omitempty"`
	State  State  `json:"state,omitempty"`
	Backup Backup `json:"backup,omitempty"`
	Group  Group  `json:"group,omitempty"`
	Source Source `json:"source,omitempty"`
}

type Context added in v1.4.0

type Context struct {
	Default   string    `json:"default"`
	Selection Selection `json:"selection"`
}

type Global

type Global struct {
	Kubeconfig string `json:"kubeconfig,omitempty"`
}

type Group

type Group struct {
	Items     []GroupItem `json:"items"`
	Selection Selection   `json:"selection"`
}

Group configuration Options

type GroupItem added in v1.4.0

type GroupItem struct {
	Name    string   `json:"name"`
	Context Context  `json:"context,omitempty"`
	Sources []string `json:"sources"`
}

type History added in v1.1.0

type History struct {
	// set the maximum history size
	Size int `json:"size"`
}

type Selection added in v1.4.0

type Selection struct {
	Default string `json:"default"`
	Sort    string `json:"sort"`
}

type Source

type Source struct {
	Items []SourceItem `json:"items"`
}

Source configuration options

type SourceItem added in v1.4.0

type SourceItem struct {
	Name    string   `json:"name"`
	Include []string `json:"include,omitempty"`
	Exclude []string `json:"exclude"`
}

type State added in v1.2.0

type State struct {
	// path of the state file
	File    string  `json:"file,omitempty"`
	History History `json:"history,omitempty"`
}

State configuration options

Jump to

Keyboard shortcuts

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