constraint

package
v0.0.0-...-461d331 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is[T any](key string, val string) interface{ TypeOf(T) }

Is matches either Eq or NotExists if value is not defined

Types

type Dyadic

type Dyadic[T any] struct {
	Op  string
	Key string
	Val interface{}
}

Dyadic operation, applied over the key * value

func CacheControl

func CacheControl[T any](val string) *Dyadic[T]

CacheControl header

func ContentEncoding

func ContentEncoding[T any](val string) *Dyadic[T]

ContentEncoding header

func ContentLanguage

func ContentLanguage[T any](val string) *Dyadic[T]

ContentLanguage header

func ContentType

func ContentType[T any](val string) *Dyadic[T]

ContentType header

func Eq

func Eq[T, A any](key string, val A) *Dyadic[T]

Eq is equal constrain

name.Eq(x) ⟼ Field = :value

func Expires

func Expires[T any](val time.Time) *Dyadic[T]

Expires header

func Ge

func Ge[T, A any](key string, val A) *Dyadic[T]

Ge is greater or equal constrain

name.Le(x) ⟼ Field >= :value

func Gt

func Gt[T, A any](key string, val A) *Dyadic[T]

Gt is greater than constrain

name.Le(x) ⟼ Field > :value

func Le

func Le[T, A any](key string, val A) *Dyadic[T]

Le is less or equal constain

name.Le(x) ⟼ Field <= :value

func Lt

func Lt[T, A any](key string, val A) *Dyadic[T]

Lt is less than constain

name.Lt(x) ⟼ Field < :value

func Ne

func Ne[T, A any](key string, val A) *Dyadic[T]

Ne is non equal constrain

name.Ne(x) ⟼ Field <> :value

func (Dyadic[T]) TypeOf

func (Dyadic[T]) TypeOf(T)

type Unary

type Unary[T any] struct {
	Op  string
	Key string
}

Unary operation, applies over the key

func Exists

func Exists[T any](key string) *Unary[T]

Exists attribute constrain

name.Exists(x) ⟼ attribute_exists(name)

func NotExists

func NotExists[T any](key string) *Unary[T]

NotExists attribute constrain

name.NotExists(x) ⟼ attribute_not_exists(name)

func (Unary[T]) TypeOf

func (Unary[T]) TypeOf(T)

Jump to

Keyboard shortcuts

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