config

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 11 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"`
	Device Device `json:"device" yaml:"device"`

	Uid    string `json:"uid"    yaml:"uid"`
	GToken string `json:"gtoken" yaml:"gtoken"`
	CToken string `json:"ctoken" yaml:"ctoken" table:",ignore"`

	Mid    string `json:"mid"    yaml:"mid"`
	SToken string `json:"stoken" yaml:"stoken" table:",ignore"`
}

func GetAccount

func GetAccount(phone string) (Account, bool)

type Config

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

	// 打码接口
	RROCRKey string `json:"rrocr.key" yaml:"rrocr.key"`
}

func C

func C() Config

func (Config) FirstAccount added in v1.1.0

func (c Config) FirstAccount() Account

type Cron

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