config

package
v0.0.0-...-5ce525d Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2016 License: Apache-2.0 Imports: 5 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 {
	Idx   int         `json:"user_idx"`
	Users []*UserInfo `json:"users"`
}

func (*Config) GetCurUser

func (c *Config) GetCurUser() *UserInfo

get current user from config

func (*Config) Load

func (c *Config) Load(fname string) error

load config

func (*Config) RemoveUser

func (c *Config) RemoveUser() error

remove current user from config

func (*Config) Save

func (c *Config) Save(fname string) error

save config

func (*Config) SwitchUser

func (c *Config) SwitchUser(appKey string) error

switch user by user's appkey from config

func (*Config) UpdateUserInfo

func (c *Config) UpdateUserInfo(u *UserInfo)

update user info in config

type UserInfo

type UserInfo struct {
	AppKey    string `json:"app_key"`
	AppSecret string `json:"app_secret"`
	Token     string `json:"token"`
	ExpiresIn uint64 `json:"expires_in"`
}

Jump to

Keyboard shortcuts

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