config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 12 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"`

	SignGameIds []string `json:"sign_game_ids" yaml:"sign_game_ids" 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"`
	TTOCR    TTOCR  `json:"ttocr"     yaml:"ttocr"`
}

func C

func C() Config

func (Config) FirstAccount added in v1.1.0

func (c Config) FirstAccount() Account

func (Config) TT added in v1.2.3

func (c Config) TT() TTOCR

type Cron

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

type TTOCR added in v1.2.3

type TTOCR struct {
	Key      string        `json:"key"      yaml:"key"`
	Interval time.Duration `json:"interval" yaml:"interval"`
	Timeout  time.Duration `json:"timeout"  yaml:"timeout"`
	// https://www.kancloud.cn/ttorc/ttorc/3119237
	ItemId string `json:"item_id"  yaml:"item_id"`
}

func TT added in v1.2.3

func TT() TTOCR

Jump to

Keyboard shortcuts

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