config

package
v0.0.0-...-ccbff5b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Save(name string, token string) error
	Remove(name string) error
	Get(name string) (Remote, error)
	Remotes() []Remote
	SetActive(name string) error
	Active() *Remote
}

type FileConfig

type FileConfig struct {
	Path string
	// contains filtered or unexported fields
}

func (*FileConfig) Active

func (c *FileConfig) Active() *Remote

func (*FileConfig) Get

func (c *FileConfig) Get(name string) (Remote, error)

func (*FileConfig) Load

func (c *FileConfig) Load() error

func (*FileConfig) Remotes

func (c *FileConfig) Remotes() []Remote

func (*FileConfig) Remove

func (c *FileConfig) Remove(name string) error

func (*FileConfig) Save

func (c *FileConfig) Save(name string, token string) error

func (*FileConfig) SetActive

func (c *FileConfig) SetActive(name string) error

type Remote

type Remote struct {
	Name       string `json:"name"`
	Token      string `json:"token"`
	Endpoint   string `json:"endpoint"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	PrivateKey string `json:"private_key"`
}

func (*Remote) DecodeToken

func (r *Remote) DecodeToken() error

type Store

type Store struct {
	Active  string   `json:"active"`
	Remotes []Remote `json:"remotes"`
}

Jump to

Keyboard shortcuts

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