config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigV2

type ConfigV2 struct {
	Profiles       map[string]Profile `yaml:"profiles"`
	DefalutProfile string             `yaml:"default_profile"`
}

func GetConfig

func GetConfig() (*ConfigV2, error)

func NewConfig

func NewConfig() *ConfigV2

func (*ConfigV2) GetDefaultProfile

func (c *ConfigV2) GetDefaultProfile() *Profile

func (*ConfigV2) GetProfile

func (c *ConfigV2) GetProfile(domain string) (*Profile, error)

func (*ConfigV2) GetToken

func (c *ConfigV2) GetToken(domain string) string

func (*ConfigV2) HasDomain

func (c *ConfigV2) HasDomain(domain string) bool

func (*ConfigV2) Load

func (c *ConfigV2) Load() error

func (*ConfigV2) Save

func (c *ConfigV2) Save() error

func (*ConfigV2) SetProfile

func (c *ConfigV2) SetProfile(domain string, profile Profile)

func (*ConfigV2) SetToken

func (c *ConfigV2) SetToken(domain, token string)

type Profile

type Profile struct {
	Token          string `yaml:"token"`
	DefaultGroup   string `yaml:"default_group"`
	DefaultProject string `yaml:"default_project"`
}

Jump to

Keyboard shortcuts

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