config

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConfigName = "config.yml"
)

Variables

View Source
var ProfileFile string

Functions

func Amend

func Amend(key string, value string) error

func Exists

func Exists() bool

func FromToken

func FromToken(token string) error

func PluralDir

func PluralDir(p ...string) (string, error)

func PluralUrl

func PluralUrl(endpoint string) string

func Profile

func Profile(name string) error

func SetConfig

func SetConfig(conf *Config)

Types

type Config

type Config struct {
	Email           string `json:"email"`
	Token           string `yaml:"token" json:"token"`
	ConsoleToken    string `yaml:"consoleToken" json:"consoleToken"`
	NamespacePrefix string `yaml:"namespacePrefix"`
	Endpoint        string `yaml:"endpoint"`
	LockProfile     string `yaml:"lockProfile"`
	ReportErrors    bool   `yaml:"reportErrors"`
	// contains filtered or unexported fields
}

func Import

func Import(file string) (conf Config)

func Read

func Read() Config

func (*Config) BaseUrl

func (c *Config) BaseUrl() string

func (*Config) Flush

func (c *Config) Flush() error

func (*Config) Marshal

func (conf *Config) Marshal() ([]byte, error)

func (*Config) Namespace

func (c *Config) Namespace(ns string) string

func (*Config) Save

func (c *Config) Save(filename string) error

func (*Config) SaveProfile

func (c *Config) SaveProfile(name string) error

func (*Config) Url

func (c *Config) Url() string

type Metadata

type Metadata struct {
	Name string `yaml:"name"`
}

type VersionedConfig

type VersionedConfig struct {
	ApiVersion string    `yaml:"apiVersion"`
	Kind       string    `yaml:"kind"`
	Metadata   *Metadata `yaml:"metadata"`
	Spec       *Config   `yaml:"spec"`
}

func Profiles

func Profiles() ([]*VersionedConfig, error)

Jump to

Keyboard shortcuts

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