element

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	THEN    string = "THEN"
	WHEN    string = "WHEN"
	SWITCH  string = "SWITCH"
	EXECUTE string = "EXECUTE"
)

Variables

This section is empty.

Functions

func GetOuterBracketContent

func GetOuterBracketContent(value string) (string, string, error)

func RegisterAssemblyBean

func RegisterAssemblyBean(bean interface{}) error

func RegisterChain

func RegisterChain(name string, assembly Assembly) error

func RegisterInterceptor

func RegisterInterceptor(bean HandleInterceptor) error

func SortHandleInterceptor

func SortHandleInterceptor(people []HandleInterceptor, by func(p, q HandleInterceptor) bool)

func SplitOuterComma

func SplitOuterComma(value string) []string

Types

type Assembly

type Assembly interface {
	Execute(Context model.ContextHandle) error
}

func GetChain

func GetChain(name string) Assembly

type BaseConditionHandle

type BaseConditionHandle interface {
	AssemblyName() string
	ProcessSwitch(context model.ContextHandle) string
}

func GetConditionAssemblyBean

func GetConditionAssemblyBean(name string) BaseConditionHandle

type BaseHandle

type BaseHandle interface {
	AssemblyName() string
	DoHandle(context model.ContextHandle) error
}

func GetBaseAssemblyBean

func GetBaseAssemblyBean(name string) BaseHandle

type ChainConfig

type ChainConfig struct {
	IsContinueOnError bool   `xml:"isContinueOnError,attr" yaml:"isContinueOnError"`
	Name              string `xml:"name,attr" yaml:"name"`
	Value             string `xml:",chardata" yaml:"value"`
}

type ChainExpression

type ChainExpression struct {
	Name              string
	IsContinueOnError bool
	NodeExpression    *NodeExpression
}

func (*ChainExpression) ParseAssembly

func (sf *ChainExpression) ParseAssembly() (Assembly, error)

type ChainList

type ChainList struct {
	ChainList []*ChainExpression
}

type ConfigHandle

type ConfigHandle interface {
	IsContinueOnError(context model.ContextHandle) bool
}

type ExecuteAssembly

type ExecuteAssembly struct {
	Handle            BaseHandle
	IsContinueOnError bool
}

func (*ExecuteAssembly) Execute

func (sf *ExecuteAssembly) Execute(Context model.ContextHandle) error

type HandleInterceptor

type HandleInterceptor interface {
	Pointcut() string
	Sort() int
	Around(context model.ContextHandle, joinPoint *JoinPoint) error
}

func GetMatchInterceptor

func GetMatchInterceptor(handle BaseHandle) []HandleInterceptor

type HelpHandle

type HelpHandle interface {
	IsAccess(context model.ContextHandle) bool
	OnSuccess(context model.ContextHandle)
	OnError(context model.ContextHandle, err error)
}

type InterceptorWrapper

type InterceptorWrapper struct {
	// contains filtered or unexported fields
}

func (InterceptorWrapper) Len

func (pw InterceptorWrapper) Len() int

func (InterceptorWrapper) Less

func (pw InterceptorWrapper) Less(i, j int) bool

func (InterceptorWrapper) Swap

func (pw InterceptorWrapper) Swap(i, j int)

type JoinPoint

type JoinPoint struct {
	// contains filtered or unexported fields
}

func NewJoinPoint

func NewJoinPoint(executeAssembly *ExecuteAssembly, handleInterceptor []HandleInterceptor) *JoinPoint

func (*JoinPoint) Execute

func (sf *JoinPoint) Execute(Context model.ContextHandle) error

type NodeExpression

type NodeExpression struct {
	//节点类型
	NodeType string
	//SubNode不为空,说明是条件节点,NodeName除了swich一定是空
	SubNode []*NodeExpression
	//NodeName不为空说明是执行节点,SubNode除了swich一定是空
	NodeName string
}

func ParseChainRule2

func ParseChainRule2(value string) (*NodeExpression, error)

type NodeType

type NodeType string

type SWITCHAssembly

type SWITCHAssembly struct {
	ConditionHandle BaseConditionHandle
	SelectAssemblys map[string]*Assembly
}

func (*SWITCHAssembly) Execute

func (sf *SWITCHAssembly) Execute(Context model.ContextHandle) error

type StreamConfig

type StreamConfig struct {
	ChainConfigs []ChainConfig `xml:"chain" yaml:"chain"`
}

func AnalysePath

func AnalysePath(path string) (*StreamConfig, error)

func (*StreamConfig) Parse

func (sf *StreamConfig) Parse() ([]*ChainExpression, error)

type ThenAssembly

type ThenAssembly struct {
	Assemblys []Assembly
}

func (*ThenAssembly) Execute

func (sf *ThenAssembly) Execute(Context model.ContextHandle) error

type WHENAssembly

type WHENAssembly struct {
	Assemblys []Assembly
}

func (*WHENAssembly) Execute

func (sf *WHENAssembly) Execute(context model.ContextHandle) error

Jump to

Keyboard shortcuts

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