config

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(account Account)

func Save

func Save() error

func UpdateAccount

func UpdateAccount(phone string, cb func(account Account) Account)

Types

type Account

type Account struct {
	Phone      string            `json:"phone"      yaml:"phone"`
	Hypergryph AccountHypergryph `json:"hypergryph" yaml:"hypergryph"`
	Skland     AccountSkland     `json:"skland"     yaml:"skland"`
}

func GetAccount

func GetAccount(phone string) (Account, bool)

type AccountHypergryph

type AccountHypergryph struct {
	Token string `json:"token" yaml:"token"`
	Code  string `json:"code"  yaml:"code"`
}

func (AccountHypergryph) TableCellString added in v1.1.0

func (v AccountHypergryph) TableCellString() string

type AccountSkland

type AccountSkland struct {
	Cred  string `json:"cred"  yaml:"cred"`
	Token string `json:"token" yaml:"token"`
}

func (AccountSkland) TableCellString added in v1.1.0

func (v AccountSkland) TableCellString() string

type Config

type Config struct {
	Accounts []Account `json:"accounts" yaml:"accounts"`
	Cron     Cron      `json:"cron"     yaml:"cron"`
}

func C

func C() Config

func (Config) FirstAccount added in v1.2.0

func (c Config) FirstAccount() Account

type Cron added in v1.0.1

type Cron struct {
	Spec    string `json:"spec"    yaml:"spec"`
	Startup bool   `json:"startup" yaml:"startup"`
}

Jump to

Keyboard shortcuts

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