account

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChUser

func ChUser(userName string) (name string, err *data.CodeError)

切换账户

func CleanUser

func CleanUser() *data.CodeError

清除本地账户数据库

func GetMac

func GetMac() (mac *qbox.Mac, err *data.CodeError)

获取Mac

func Load

func Load(i LoadInfo) *data.CodeError

Load 保证 AccountPath、OldAccountPath、AccountDBPath 均不为空

func RmUser

func RmUser(userName string) *data.CodeError

从本地数据库删除用户

func SaveToDB

func SaveToDB(acc Account, accountOver bool) (err *data.CodeError)

func SetAccountToLocalFile

func SetAccountToLocalFile(acc Account) (err *data.CodeError)

保存账户信息到账户文件中

Types

type Account

type Account struct {
	Name      string
	AccessKey string
	SecretKey string
}

Account - 用户自定义的账户名称

func GetAccount

func GetAccount() (account Account, err *data.CodeError)

返回Account

func GetOldAccount

func GetOldAccount() (account Account, err *data.CodeError)

qshell 会记录当前的user信息,当切换账户后, 老的账户信息会记录下来 qshell user cu就可以切换到老的账户信息, 参考cd -回到先前的目录

func GetUsers

func GetUsers() (ret []*Account, err *data.CodeError)

获取用户列表

func LookUp

func LookUp(userName string) ([]Account, *data.CodeError)

LookUp 查找用户

func (*Account) String

func (acc *Account) String() string

type LoadInfo

type LoadInfo struct {
	AccountPath    string
	OldAccountPath string
	AccountDBPath  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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