handler

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic struct {
	ID   string
	Name string
}

type BillRecord

type BillRecord struct {
	ID           string
	Cost         float64
	Traffic      string
	UsedDuration string
	Date         string
}

type DashboardHandler

type DashboardHandler struct {
	// contains filtered or unexported fields
}

func NewDashboardHandler

func NewDashboardHandler() *DashboardHandler

func (*DashboardHandler) GetBasic

func (d *DashboardHandler) GetBasic() (*Basic, error)

func (*DashboardHandler) GetBill

func (d *DashboardHandler) GetBill(page int) ([]BillRecord, error)

func (*DashboardHandler) GetDevice

func (d *DashboardHandler) GetDevice() ([]Device, error)

func (*DashboardHandler) GetPackage

func (d *DashboardHandler) GetPackage() (*Package, error)

func (*DashboardHandler) GetRecharge

func (d *DashboardHandler) GetRecharge(page int) ([]RechargeRecord, error)

func (*DashboardHandler) GetUsageRecords

func (d *DashboardHandler) GetUsageRecords(page int) ([]UsageRecord, error)

func (*DashboardHandler) Login

func (d *DashboardHandler) Login(account *model.Account) error

type Device

type Device struct {
	ID        int
	IP        string
	StartTime string
	SID       string
}

type IpgwHandler

type IpgwHandler struct {
	// contains filtered or unexported fields
}

func NewIpgwHandler

func NewIpgwHandler() *IpgwHandler

func (*IpgwHandler) FetchUsageInfo

func (h *IpgwHandler) FetchUsageInfo() error

func (*IpgwHandler) GetClient

func (h *IpgwHandler) GetClient() *http.Client

func (*IpgwHandler) GetInfo

func (h *IpgwHandler) GetInfo() *model.Info

func (*IpgwHandler) IsConnectedAndLoggedIn added in v0.1.1

func (h *IpgwHandler) IsConnectedAndLoggedIn() (connected bool, loggedIn bool)

func (*IpgwHandler) Kick

func (h *IpgwHandler) Kick(sid string) (bool, error)

func (*IpgwHandler) Login

func (h *IpgwHandler) Login(account *model.Account) error

func (*IpgwHandler) Logout

func (h *IpgwHandler) Logout() error

func (*IpgwHandler) NEUAuth added in v0.2.0

func (h *IpgwHandler) NEUAuth(username, password string) error

func (*IpgwHandler) ParseBasicInfo added in v0.1.3

func (h *IpgwHandler) ParseBasicInfo() error

type Package

type Package struct {
	PackageCost  string
	UsedTraffic  string
	UsedDuration string
	Balance      string
	// Balance < 0
	Overdue bool
}

type RechargeRecord

type RechargeRecord struct {
	ID   string
	Cost string
	Time string
}

type StoreHandler

type StoreHandler struct {
	Path   string
	Config *model.Config
}

func NewStoreHandler

func NewStoreHandler(path string) (*StoreHandler, error)

func (*StoreHandler) Load

func (h *StoreHandler) Load() error

func (*StoreHandler) Persist

func (h *StoreHandler) Persist() error

type UpdateHandler

type UpdateHandler struct {
	// contains filtered or unexported fields
}

func NewUpdateHandler

func NewUpdateHandler() *UpdateHandler

func (*UpdateHandler) CheckLatestVersion

func (u *UpdateHandler) CheckLatestVersion() (bool, error)

CheckLatestVersion returns true when there is a newer version

func (*UpdateHandler) Update

func (u *UpdateHandler) Update() error

type UsageRecord

type UsageRecord struct {
	StartTime    string
	EndTime      string
	IP           string
	Traffic      string
	UsedDuration string
}

Jump to

Keyboard shortcuts

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