cmds

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtractCommandManager func(ctx context.Context) ICommandManager
View Source
var NewCommandExecutor func(plugin IPlugin) (ICommandExecutor, error)
View Source
var NewCommandHooks func() ICommandHooks
View Source
var NewCommandInfo func(plugin IPlugin, cmd ICommand, hooks ...ICommandHooks) ICommandInfo
View Source
var NewCommandManager func() (res ICommandManager)
View Source
var NewCommandSignature func(kind Kind, category []Category, action Action) ICommandSignature
View Source
var SetCommandManager func(ctx context.Context, manager ICommandManager) error

Functions

This section is empty.

Types

type Action

type Action = include.EventAction

type BaseCmd

type BaseCmd struct{}

BaseCmd является основой для описания своих собственных комманд.

Важно: Команда не может и не должна хранить какие-либо данные. Так как один экземпляр используется во множестве горутин... Все методы следует считать статическими. А экземпляры комманд синглетонами.

func (*BaseCmd) Action

func (b *BaseCmd) Action() Action

Action возвращает действие команды

func (*BaseCmd) Category

func (b *BaseCmd) Category() []Category

Category возвращает категорию команды

func (*BaseCmd) CheckAccess

func (b *BaseCmd) CheckAccess(ctx context.Context, event IEvent) (ok bool, err error)

CheckAccess проверяет права на выполнение команды для заданного ивента

func (*BaseCmd) CheckOnResultAccess

func (b *BaseCmd) CheckOnResultAccess(ctx context.Context, event IEvent) (ok bool, err error)

func (*BaseCmd) Execute

func (b *BaseCmd) Execute(ctx context.Context, event IEvent) (IEvent, error)

Execute выполняет команду для заданного ивента

func (*BaseCmd) Kind

func (b *BaseCmd) Kind() Kind

Kind возвращает вид команды

func (*BaseCmd) Name

func (b *BaseCmd) Name() string

Name возвращает имя команды

func (*BaseCmd) OnResult

func (b *BaseCmd) OnResult(ctx context.Context, event IEvent) (IEvent, error)

func (*BaseCmd) OnResultError

func (b *BaseCmd) OnResultError(ctx context.Context, event IEvent) (IEvent, error)

type Category

type Category = include.EventCategory

type CommandExecutorProto

type CommandExecutorProto = include.CommandExecutorProto

type ICommand

type ICommand = include.ICommand

type ICommandExecutor

type ICommandExecutor = include.ICommandExecutor

type ICommandHooks

type ICommandHooks = include.ICommandHooks

type ICommandInfo

type ICommandInfo = include.ICommandInfo

type ICommandManager

type ICommandManager = include.ICommandManager

type ICommandSignature

type ICommandSignature = include.ICommandSignature

type IEngine

type IEngine = include.IEngine

type IEvent

type IEvent = include.IEvent

type IPlugin

type IPlugin = include.IPlugin

type Kind

type Kind = include.EventKind

type UUID

type UUID = include.UUID

Jump to

Keyboard shortcuts

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