validator

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToTable

func MapToTable(m map[string]interface{}) *lua.LTable

MapToTable convert map[strign]interface{} into lua table Adopted from here https://github.com/yuin/gopher-lua/issues/160

Types

type CELValidator

type CELValidator struct {
	*Validator
	// contains filtered or unexported fields
}

func NewCELValidator

func NewCELValidator(c *config.ValidatorConfig) (*CELValidator, error)

func (*CELValidator) Exec

func (v *CELValidator) Exec(data map[string]interface{}) (bool, error)

type Helper

type Helper struct {
}

func (*Helper) Duration

func (h *Helper) Duration(value string) float64

func (*Helper) UnixTime

func (h *Helper) UnixTime() float64

type L4Config

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

type L4ValidatorExtra

type L4ValidatorExtra struct {
	Timeout string `mapstructure:"timeout,omitempty"`
	Proto   string `mapstructure:"proto"`
	Data    string `mapstructure:"data,omitempty"`
	Send    bool   `mapstructure:"send,omitempty"`
}

type LuaValidator

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

func NewLuaValidator

func NewLuaValidator(vc *config.ValidatorConfig) (*LuaValidator, error)

func (*LuaValidator) Exec

func (v *LuaValidator) Exec(data map[string]interface{}) (bool, error)

func (*LuaValidator) IsMajor

func (v *LuaValidator) IsMajor() bool

func (*LuaValidator) Name

func (v *LuaValidator) Name() string

func (*LuaValidator) Title

func (v *LuaValidator) Title() string

type Result

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

func (*Result) Get

func (r *Result) Get() bool

func (*Result) Set

func (r *Result) Set(value bool)

type ScriptValidator

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

func NewScriptValidator

func NewScriptValidator(c *config.ValidatorConfig) (*ScriptValidator, error)

func (*ScriptValidator) Exec

func (v *ScriptValidator) Exec(data map[string]interface{}) (bool, error)

func (*ScriptValidator) IsMajor

func (v *ScriptValidator) IsMajor() bool

func (*ScriptValidator) Name

func (v *ScriptValidator) Name() string

func (*ScriptValidator) Title

func (v *ScriptValidator) Title() string

type TCPValidator

type TCPValidator struct {
	*Validator
	// contains filtered or unexported fields
}

func (*TCPValidator) Exec

func (v *TCPValidator) Exec(data map[string]any) (bool, error)

type UDPValidator

type UDPValidator struct {
	*Validator
	// contains filtered or unexported fields
}

func (*UDPValidator) Exec

func (v *UDPValidator) Exec(data map[string]any) (bool, error)

type Validator

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

func NewValidatorBase

func NewValidatorBase(c *config.ValidatorConfig) *Validator

func (*Validator) IsMajor

func (v *Validator) IsMajor() bool

func (*Validator) Name

func (v *Validator) Name() string

func (*Validator) Title

func (v *Validator) Title() string

type ValidatorInterface

type ValidatorInterface interface {
	Exec(data map[string]interface{}) (bool, error)
	Title() string
	Name() string
	IsMajor() bool
}

Jump to

Keyboard shortcuts

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