config

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 9 Imported by: 0

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