config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDataTest = `` /* 138-byte string literal not displayed */
View Source
var PreferredDomainTest = []string{
	"gitlab.ssl.domain1.jp",
	"gitlab.ssl.domain2.jp",
}
View Source
var TokensTest = yaml.MapSlice{
	yaml.MapItem{
		Key:   "gitlab.ssl.domain1.jp",
		Value: "token1",
	},
	yaml.MapItem{
		Key:   "gitlab.ssl.domain2.jp",
		Value: "token2",
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Tokens           yaml.MapSlice
	PreferredDomains []string
}

func NewConfigWithFile

func NewConfigWithFile(filepath string) (*Config, error)

func (*Config) AddRepository

func (c *Config) AddRepository(repository string)

type ConfigManager

type ConfigManager struct {
	Path   string
	Config *Config
}

func NewConfigManager

func NewConfigManager() *ConfigManager

func NewConfigManagerPath

func NewConfigManagerPath(path string) *ConfigManager

func (*ConfigManager) GetToken

func (c *ConfigManager) GetToken(ui ui.Ui, domain string) (string, error)

func (*ConfigManager) GetTokenOnly

func (c *ConfigManager) GetTokenOnly(domain string) string

func (*ConfigManager) GetTopDomain

func (c *ConfigManager) GetTopDomain() string

func (*ConfigManager) Init

func (c *ConfigManager) Init() error

func (*ConfigManager) Load

func (c *ConfigManager) Load() (conf *Config, err error)

func (*ConfigManager) Save

func (c *ConfigManager) Save() error

func (*ConfigManager) SavePreferredDomain

func (c *ConfigManager) SavePreferredDomain(domain string) error

func (*ConfigManager) SaveToken

func (c *ConfigManager) SaveToken(domain, token string) error

func (*ConfigManager) TopPriorityDomain

func (c *ConfigManager) TopPriorityDomain(domains []string) string

Jump to

Keyboard shortcuts

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