config

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey string `json:"apiKey"`
	Dir    string `json:"dir"`
	API    string `json:"api"`
	XAPI   string `json:"xapi"`
	File   string `json:"-"` // full path to config file
}

Config represents the settings for particular user. This defines both the auth for talking to the API, as well as where to put problems that get downloaded.

func New

func New(path string) (*Config, error)

New returns a configuration struct with content from the exercism.json file

func (*Config) IsAuthenticated added in v1.7.1

func (c *Config) IsAuthenticated() bool

IsAuthenticated returns true if the config contains an API key. This does not check whether or not that key is valid.

func (*Config) Update added in v1.7.2

func (c *Config) Update(key, host, dir, xapi string) error

Update sets new values where given.

func (*Config) Write

func (c *Config) Write() error

Write saves the config as JSON.

Jump to

Keyboard shortcuts

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