Documentation ¶
Overview ¶
Package conf gives the CLI access to the nerd config file. By default this config file is ~/.nerd/config.json, but the location can be changed using SetLocation().
All read and write operation to the config file should go through the Read() and Write() functions. This way we can keep an in-memory representation of the config (in the global conf variable) for fast read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocation ¶
GetLocation gets the location and sets it to default it is unset.
func SetDefaultLocation ¶
func SetDefaultLocation() error
SetDefaultLocation sets the location to ~/.nerd/config.json
func SetLocation ¶
SetLocation sets the location of the config file.
func WriteNerdToken ¶
WriteNerdToken sets the nerd token and calls Write() to write to disk.
Types ¶
type AuthConfig ¶
type AuthConfig struct { APIEndpoint string `json:"api_endpoint"` PublicKey string `json:"public_key"` }
AuthConfig contains config details with respect to authentication.
type Config ¶
type Config struct { Auth AuthConfig `json:"auth"` EnableLogging bool `json:"enable_logging"` CurrentProject string `json:"current_project"` NerdToken string `json:"nerd_token"` NerdAPIEndpoint string `json:"nerd_api_endpoint"` }
Config is the structure that describes how the config file looks.