config

package
v1.0.0-alpha-23 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup() error

Setup the environment

func Teardown

func Teardown()

Teardown resets the configuration environment

Types

type Config

type Config struct {
	Username        string  `ini:"username"`
	Password        string  `ini:"password"`
	Token           string  `ini:"token"`
	Local           bool    `ini:"local"`
	LocalPort       int     `ini:"local_port"`
	NoColor         bool    `ini:"disable_colors"`
	Endpoint        string  `ini:"endpoint"`
	NotifyUpdates   bool    `ini:"notify_updates"`
	ReleaseChannel  string  `ini:"release_channel"`
	LastUpdateCheck string  `ini:"last_update_check"`
	NextVersion     string  `ini:"next_version"`
	Path            string  `ini:"-"`
	Remotes         Remotes `ini:"-"`
	// contains filtered or unexported fields
}

Config of the application

var (
	// Global configuration
	Global *Config

	// Context stores the environmental context
	Context *usercontext.Context
)

func (*Config) Load

func (c *Config) Load() error

Load the configuration

func (*Config) Save

func (c *Config) Save() error

Save the configuration

type RemoteConfig

type RemoteConfig struct {
	URL        string
	URLComment string
	Comment    string
}

RemoteConfig for a remote

type Remotes

type Remotes struct {
	// contains filtered or unexported fields
}

Remotes (list of alternative endpoints)

func (*Remotes) Del

func (r *Remotes) Del(name string)

Del deletes a remote by name

func (*Remotes) Get

func (r *Remotes) Get(name string) (RemoteConfig, bool)

Get a given remote by name

func (*Remotes) List

func (r *Remotes) List() []string

List remotes

func (*Remotes) Set

func (r *Remotes) Set(name string, url string, comment ...string)

Set a remote

Jump to

Keyboard shortcuts

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