manager

package
v0.0.0-...-84adcdc Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package manager provides a simple group plugin Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

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

ForEach iterates through managers.

Types

type Manager

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

Manager is the plugin group manager.

func Lookup

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

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

func New

func New(service string, o *Options) *Manager

New returns Manager with settings.

func (*Manager) Disable

func (m *Manager) Disable(groupID int64)

Disable disables a group to pass the Manager.

func (*Manager) Enable

func (m *Manager) Enable(groupID int64)

Enable enables a group to pass the Manager.

func (*Manager) Handler

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

Handler 返回 预处理器

type Options

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

Options holds the optional parameters for the Manager.

Jump to

Keyboard shortcuts

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