control

package
v1.2.2-beta2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package control 控制插件的启用与优先级等

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(service string)

Delete 删除插件控制器,不会删除数据

func ForEach

func ForEach(iterator func(key string, manager *Control) bool)

ForEach iterates through managers.

func Register

func Register(service string, o *Options) *zero.Engine

Register 注册插件控制器

Types

type Control

type Control struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Control is to control the plugins.

func Lookup

func Lookup(service string) (*Control, bool)

Lookup returns a Manager by the service name, if not exist, it will returns nil.

func (*Control) Disable

func (m *Control) Disable(groupID int64)

Disable disables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.

func (*Control) Enable

func (m *Control) Enable(groupID int64)

Enable enables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.

func (*Control) GetData

func (m *Control) GetData(gid int64) int64

GetData 获取某个群的 63 字节配置信息

func (*Control) Handler

func (m *Control) Handler() zero.Rule

Handler 返回 预处理器

func (*Control) IsEnabledIn

func (m *Control) IsEnabledIn(gid int64) bool

IsEnabledIn 开启群

func (*Control) Reset

func (m *Control) Reset(groupID int64)

Reset resets the default config of a group. groupID == 0 (ALL) is not allowed.

func (*Control) SetData

func (m *Control) SetData(groupID int64, data int64) error

SetData 为某个群设置低 63 位配置数据

type Options

type Options struct {
	DisableOnDefault bool
	Help             string // 帮助文本信息
}

Options holds the optional parameters for the Manager.

Directories

Path Synopsis
Package webctrl * 一个用户webui的包,里面包含了webui所需的所有内容
Package webctrl * 一个用户webui的包,里面包含了webui所需的所有内容

Jump to

Keyboard shortcuts

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