model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Username          string `json:"username"`
	Password          string `json:"-"`
	Cookie            string `json:"-"`
	Secret            string `json:"-"`
	EncryptedPassword string `json:"encrypted_password"`
}

func (*Account) GetPassword

func (a *Account) GetPassword() (string, error)

func (*Account) SetPassword

func (a *Account) SetPassword(password string, secret []byte) error

func (*Account) String added in v0.1.3

func (a *Account) String() string

type Config

type Config struct {
	DefaultAccount string     `json:"default_account"`
	Accounts       []*Account `json:"accounts"`
}

func (*Config) AddAccount

func (c *Config) AddAccount(username, password, secret string) error

func (*Config) DelAccount

func (c *Config) DelAccount(username string) bool

func (*Config) GetAccount

func (c *Config) GetAccount(username string) *Account

func (*Config) GetDefaultAccount

func (c *Config) GetDefaultAccount() *Account

func (*Config) SetDefaultAccount

func (c *Config) SetDefaultAccount(username string) bool

type Info

type Info struct {
	Username          string
	IP                string
	Traffic, UsedTime int
	Balance           float64
}

func (*Info) FormattedBalance

func (i *Info) FormattedBalance() string

func (*Info) FormattedTraffic

func (i *Info) FormattedTraffic() string

func (*Info) FormattedUsedTime

func (i *Info) FormattedUsedTime() string

Jump to

Keyboard shortcuts

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