base

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAssertion = errors.New("assertion error")
)

Functions

func FormatValue

func FormatValue(val core.Value) string

func NewNegativeAssertion

func NewNegativeAssertion(assertion Assertion) core.Function

func NewPositiveAssertion

func NewPositiveAssertion(assertion Assertion) core.Function

Types

type Assertion

type Assertion struct {
	DefaultMessage MessageFn
	MinArgs        int
	MaxArgs        int
	Fn             AssertionFn
}

type AssertionFn

type AssertionFn func(ctx context.Context, args []core.Value) (bool, error)

type CompareOperator

type CompareOperator int
const (
	NotEqualOp       CompareOperator = 0
	EqualOp          CompareOperator = 1
	LessOp           CompareOperator = 2
	LessOrEqualOp    CompareOperator = 3
	GreaterOp        CompareOperator = 4
	GreaterOrEqualOp CompareOperator = 5
)

func (CompareOperator) Compare

func (op CompareOperator) Compare(args []core.Value) (bool, error)

func (CompareOperator) String

func (op CompareOperator) String() string

type MessageFn

type MessageFn func(args []core.Value) string

Jump to

Keyboard shortcuts

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