control

package
v1.1.7-beta7-fix3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const ALL int64 = 0

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) Handler

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

Handler 返回 预处理器

func (*Control) IsEnabledIn

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

IsEnabledIn 开启群

type Options

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

Options holds the optional parameters for the Manager.

Directories

Path Synopsis
Package web 网页管理后端
Package web 网页管理后端

Jump to

Keyboard shortcuts

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