store

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParse = errors.New("序列化账号错误")
View Source
var ErrReadFile = errors.New("读取账号文件错误")
View Source
var ErrWriteFile = errors.New("写入账号文件错误")
View Source
var RootPath string

Functions

func SetAccount

func SetAccount(username, password, def string) (err error)

写入账号信息到文件 统一错误

func SetInfo

func SetInfo(token, ip string) (err error)

保存token

Types

type Account

type Account struct {
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	AccessToken string `json:"access_token"`
	Ip          string `json:"ip"`
	Server      string `json:"server"`
}

func LoadAccount

func LoadAccount() (account Account, err error)

func (*Account) String

func (acc *Account) String() string

Jump to

Keyboard shortcuts

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