configure

package
v0.0.2-0...-03c5ad4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveFile

func SaveFile(path string, config *Config) error

Types

type Config

type Config struct {
	Server struct {
		Default string `toml:"default"`
	} `toml:"server"`

	Servers Servers `toml:"servers"`
}

func (*Config) Decode

func (c *Config) Decode(r io.Reader) error

func (*Config) Encode

func (c *Config) Encode(w io.Writer) error

func (*Config) Marshal

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

func (*Config) Unmarshal

func (c *Config) Unmarshal(b []byte) error

type CredentialStore

type CredentialStore string

func (CredentialStore) IsAutomatic

func (cs CredentialStore) IsAutomatic() bool

func (CredentialStore) TryGnomeSS

func (cs CredentialStore) TryGnomeSS() bool

func (CredentialStore) TryKeychain

func (cs CredentialStore) TryKeychain() bool

func (CredentialStore) TryNetRC

func (cs CredentialStore) TryNetRC() bool

func (CredentialStore) TryWincred

func (cs CredentialStore) TryWincred() bool

type FileConfig

type FileConfig struct {
	Config
	// contains filtered or unexported fields
}

func LoadFile

func LoadFile(path string) (*FileConfig, error)

func NewFile

func NewFile(path string) (*FileConfig, error)

func (*FileConfig) Load

func (fc *FileConfig) Load() error

func (*FileConfig) Path

func (fc *FileConfig) Path() string

func (*FileConfig) Save

func (fc *FileConfig) Save() error

type Server

type Server struct {
	Name            string          `toml:"name"`
	URL             string          `toml:"url"`
	SSH             string          `toml:"ssh"`
	CredentialStore CredentialStore `toml:"credential-store"`
}

func (*Server) Rel

func (s *Server) Rel(urlStr string) (string, bool)

type Servers

type Servers []Server

func (*Servers) Add

func (ss *Servers) Add(name, url string)

func (Servers) Get

func (ss Servers) Get(name string) *Server

func (*Servers) Remove

func (ss *Servers) Remove(name string) *Server

Jump to

Keyboard shortcuts

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