config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 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"`
	DevCode string `json:"dev_code" yaml:"dev_code"`
	Source  string `json:"source"   yaml:"source"`
	Version string `json:"version"  yaml:"version"`
	Token   string `json:"token"    yaml:"token"   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"`
}

func C

func C() Config

func (Config) FirstAccount

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