base

package
v2.0.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 4 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 runtime.Value) string

func NewNegativeAssertion

func NewNegativeAssertion(assertion Assertion) runtime.Function

func NewPositiveAssertion

func NewPositiveAssertion(assertion Assertion) runtime.Function

Types

type Args

type Args struct {
	Min int
	Max int
}

type Assertion

type Assertion struct {
	DefaultMessage MessageFn
	Fn             AssertionFn
	Args           Args
}

func EqualityAssertion

func EqualityAssertion(op CompareOperator) Assertion

func TypeAssertion

func TypeAssertion(expected runtime.Type) Assertion

type AssertionFn

type AssertionFn func(ctx context.Context, args []runtime.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 []runtime.Value) (bool, error)

func (CompareOperator) String

func (op CompareOperator) String() string

type MessageFn

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

Jump to

Keyboard shortcuts

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