config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFile string = "config"

user config file name

View Source
var UserConfigDir string

user config directory, default be ""

Functions

func LoadOption

func LoadOption() (err error)

func Save

func Save() (err error)

func SetAPIKey

func SetAPIKey(key string) (err error)

func SetSystem

func SetSystem(sys System) (err error)

func SetToken

func SetToken(t string) (err error)

func SetUser

func SetUser(u *User) (err error)

Types

type Option

type Option struct {
	Token  string  `json:"token"`
	User   *User   `json:"user"`
	APIKey string  `json:"apiKey"`
	System *System `json:"system"`
}
var GlobalOption *Option = new(Option)

khadijah global config option

type System

type System struct {
	Version      string `json:"version"`
	BaseURL      string `json:"baseURL"`
	WebsocketURL string `json:"websocketURL"`
}

type User

type User struct {
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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