aipstr

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 4 Imported by: 0

README

aipstr

Features

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFilter added in v0.0.3

func ParseFilter[T any](b Builder[T], filter *expr.Expr) (T, error)

Types

type BoolValue added in v0.0.3

type BoolValue struct {
	Value bool
	// contains filtered or unexported fields
}

func (BoolValue) IntoBool added in v0.0.3

func (b BoolValue) IntoBool() (bool, bool)

func (BoolValue) IntoDuration added in v0.0.3

func (BoolValue) IntoDuration() (time.Duration, bool)

func (BoolValue) IntoFloat added in v0.0.3

func (BoolValue) IntoFloat() (float64, bool)

func (BoolValue) IntoIdent added in v0.0.3

func (BoolValue) IntoIdent() ([]string, bool)

func (BoolValue) IntoInt added in v0.0.3

func (BoolValue) IntoInt() (int64, bool)

func (BoolValue) IntoString added in v0.0.3

func (BoolValue) IntoString() (string, bool)

func (BoolValue) IntoTime added in v0.0.3

func (BoolValue) IntoTime() (time.Time, bool)

type Builder added in v0.0.3

type Builder[T any] interface {
	Standalone(value Value) (T, error)
	Function(op string, target T, args ...T) (T, error)
}

type FloatValue added in v0.0.2

type FloatValue struct {
	Value float64
	// contains filtered or unexported fields
}

func (FloatValue) IntoBool added in v0.0.2

func (FloatValue) IntoBool() (bool, bool)

func (FloatValue) IntoDuration added in v0.0.3

func (FloatValue) IntoDuration() (time.Duration, bool)

func (FloatValue) IntoFloat added in v0.0.2

func (f FloatValue) IntoFloat() (float64, bool)

func (FloatValue) IntoIdent added in v0.0.2

func (FloatValue) IntoIdent() ([]string, bool)

func (FloatValue) IntoInt added in v0.0.2

func (FloatValue) IntoInt() (int64, bool)

func (FloatValue) IntoString added in v0.0.2

func (FloatValue) IntoString() (string, bool)

func (FloatValue) IntoTime added in v0.0.3

func (FloatValue) IntoTime() (time.Time, bool)

type IdentValue added in v0.0.2

type IdentValue struct {
	Value []string
	// contains filtered or unexported fields
}

func (IdentValue) IntoBool added in v0.0.2

func (IdentValue) IntoBool() (bool, bool)

func (IdentValue) IntoDuration added in v0.0.3

func (IdentValue) IntoDuration() (time.Duration, bool)

func (IdentValue) IntoFloat added in v0.0.2

func (IdentValue) IntoFloat() (float64, bool)

func (IdentValue) IntoIdent added in v0.0.2

func (i IdentValue) IntoIdent() ([]string, bool)

func (IdentValue) IntoInt added in v0.0.2

func (IdentValue) IntoInt() (int64, bool)

func (IdentValue) IntoString added in v0.0.2

func (IdentValue) IntoString() (string, bool)

func (IdentValue) IntoTime added in v0.0.3

func (IdentValue) IntoTime() (time.Time, bool)

type IntValue added in v0.0.2

type IntValue struct {
	Value int64
	// contains filtered or unexported fields
}

func (IntValue) IntoBool added in v0.0.2

func (IntValue) IntoBool() (bool, bool)

func (IntValue) IntoDuration added in v0.0.3

func (IntValue) IntoDuration() (time.Duration, bool)

func (IntValue) IntoFloat added in v0.0.2

func (IntValue) IntoFloat() (float64, bool)

func (IntValue) IntoIdent added in v0.0.2

func (IntValue) IntoIdent() ([]string, bool)

func (IntValue) IntoInt added in v0.0.2

func (i IntValue) IntoInt() (int64, bool)

func (IntValue) IntoString added in v0.0.2

func (IntValue) IntoString() (string, bool)

func (IntValue) IntoTime added in v0.0.3

func (IntValue) IntoTime() (time.Time, bool)

type NestedBuilder added in v0.0.3

type NestedBuilder[T any] interface {
	// special func, allow special use-case
	// example "variants:(id = 1 OR name = 'foo')" means
	// filter records which has variants with id = 1 or name = 'foo'
	HasNestedBuilder(field []string, exc func(Builder[T]) (T, error)) (T, error)
}

type StringValue added in v0.0.2

type StringValue struct {
	Value string
	// contains filtered or unexported fields
}

func (StringValue) IntoBool added in v0.0.2

func (StringValue) IntoBool() (bool, bool)

func (StringValue) IntoDuration added in v0.0.3

func (s StringValue) IntoDuration() (time.Duration, bool)

func (StringValue) IntoFloat added in v0.0.2

func (StringValue) IntoFloat() (float64, bool)

func (StringValue) IntoIdent added in v0.0.2

func (StringValue) IntoIdent() ([]string, bool)

func (StringValue) IntoInt added in v0.0.2

func (StringValue) IntoInt() (int64, bool)

func (StringValue) IntoString added in v0.0.2

func (s StringValue) IntoString() (string, bool)

func (StringValue) IntoTime added in v0.0.3

func (s StringValue) IntoTime() (time.Time, bool)

type UnimplementedBuilder added in v0.0.3

type UnimplementedBuilder[T any] struct{}

func (UnimplementedBuilder[T]) Function added in v0.0.3

func (UnimplementedBuilder[T]) Function(op string, target T, args ...T) (T, error)

func (UnimplementedBuilder[T]) Standalone added in v0.0.3

func (UnimplementedBuilder[T]) Standalone(value Value) (T, error)

type Value

type Value interface {
	IntoIdent() ([]string, bool)
	IntoInt() (int64, bool)
	IntoFloat() (float64, bool)
	IntoBool() (bool, bool)
	IntoString() (string, bool)
	IntoDuration() (time.Duration, bool)
	IntoTime() (time.Time, bool)
}

Jump to

Keyboard shortcuts

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