action

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(p *Process, process *process.Process) (interface{}, error)

Handler action handler

type Process

type Process struct {
	Name        string        `json:"-"`
	Process     string        `json:"process,omitempty"`
	ProcessBind string        `json:"bind,omitempty"`
	Guard       string        `json:"guard,omitempty"`
	Default     []interface{} `json:"default,omitempty"`
	Disable     bool          `json:"disable,omitempty"`
	Before      *hook.Before  `json:"-"`
	After       *hook.After   `json:"-"`
	Handler     Handler       `json:"-"`
}

Process action.search ...

func NewProcess

func NewProcess() *Process

NewProcess create a new process

func ProcessOf

func ProcessOf(p *Process) *Process

ProcessOf create of get a process

func (*Process) Args

func (p *Process) Args(process *process.Process) []interface{}

Args get the process args

func (*Process) Bind

func (p *Process) Bind(processName string)

Bind the process name

func (*Process) DefaultMerge

func (p *Process) DefaultMerge(defaults []interface{}, option ...bool)

DefaultMerge merge the default value. option[0] the default is false, if true overwrite by the default value; option[1] the default is true, if true deep merge map and slice;

func (*Process) Exec

func (p *Process) Exec(process *process.Process) (interface{}, error)

Exec exec the process

func (*Process) Merge

func (p *Process) Merge(newProcess *Process) *Process

Merge a process

func (*Process) MustExec

func (p *Process) MustExec(process *process.Process) interface{}

MustExec exec the process

func (*Process) SetHandler

func (p *Process) SetHandler(handler Handler) *Process

SetHandler set the handler

func (*Process) SetName

func (p *Process) SetName(name string)

SetName set the process name

func (*Process) UseGuard

func (p *Process) UseGuard(c *gin.Context, id string) error

UseGuard using the guard in action

func (*Process) WithAfter

func (p *Process) WithAfter(after *hook.After) *Process

WithAfter bind after hook

func (*Process) WithBefore

func (p *Process) WithBefore(before *hook.Before) *Process

WithBefore bind before hook

Jump to

Keyboard shortcuts

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