config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: Apache-2.0 Imports: 3 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"`

	Did  string `json:"did"  yaml:"did"`
	Ltp0 string `json:"ltp0" yaml:"ltp0"`

	Room    int      `json:"room"    yaml:"room"`
	Assigns []Assign `json:"assigns" yaml:"assigns" table:",ignore"`

	IgnoreExpiredCheck bool `json:"ignore_expired_check" yaml:"ignore_expired_check" table:",ignore"`
}

func GetAccount

func GetAccount(phone string) (Account, bool)

func GetAccountOrFirst

func GetAccountOrFirst(phones ...string) Account

func (Account) GetKey

func (account Account) GetKey() string

type Assign

type Assign struct {
	Count int  `json:"count,omitempty" yaml:"count,omitempty"`
	Room  int  `json:"room,omitempty"  yaml:"room,omitempty"`
	All   bool `json:"all,omitempty"   yaml:"all,omitempty"`
}

type Config

type Config struct {
	Accounts cfg.Accounts[Account] `json:"accounts" yaml:"accounts"`
}

func C

func C() Config

Jump to

Keyboard shortcuts

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