ctx

package
v0.0.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefalutHTTPAddr = "127.0.0.1:5030"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	History map[string]conf.ProcessConfig

	// 微信账号相关状态
	Account     string
	Platform    string
	Version     int
	FullVersion string
	DataDir     string
	DataKey     string
	DataUsage   string
	ImgKey      string

	// 工作目录相关状态
	WorkDir   string
	WorkUsage string

	// HTTP服务相关状态
	HTTPEnabled bool
	HTTPAddr    string

	// 自动解密
	AutoDecrypt bool
	LastSession time.Time

	// 当前选中的微信实例
	Current *wechat.Account
	PID     int
	ExePath string
	Status  string

	// 所有可用的微信实例
	WeChatInstances []*wechat.Account
	// contains filtered or unexported fields
}

Context is a context for a chatlog. It is used to store information about the chatlog.

func New

func New(configPath string) (*Context, error)

func (*Context) GetDataDir added in v0.0.20

func (c *Context) GetDataDir() string

func (*Context) GetDataKey added in v0.0.20

func (c *Context) GetDataKey() string

func (*Context) GetHTTPAddr added in v0.0.20

func (c *Context) GetHTTPAddr() string

func (*Context) GetPlatform added in v0.0.20

func (c *Context) GetPlatform() string

func (*Context) GetVersion added in v0.0.20

func (c *Context) GetVersion() int

func (*Context) GetWebhook added in v0.0.25

func (c *Context) GetWebhook() *conf.Webhook

func (*Context) GetWorkDir added in v0.0.20

func (c *Context) GetWorkDir() string

func (*Context) Refresh

func (c *Context) Refresh()

func (*Context) SetAutoDecrypt added in v0.0.11

func (c *Context) SetAutoDecrypt(enabled bool)

func (*Context) SetDataDir

func (c *Context) SetDataDir(dir string)

func (*Context) SetHTTPAddr

func (c *Context) SetHTTPAddr(addr string)

func (*Context) SetHTTPEnabled

func (c *Context) SetHTTPEnabled(enabled bool)

func (*Context) SetWorkDir

func (c *Context) SetWorkDir(dir string)

func (*Context) SwitchCurrent

func (c *Context) SwitchCurrent(info *wechat.Account)

func (*Context) SwitchHistory

func (c *Context) SwitchHistory(account string)

func (*Context) UpdateConfig

func (c *Context) UpdateConfig()

更新配置

Jump to

Keyboard shortcuts

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