types

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ErrWrongTypeAssertion is custom error for wrong type assertions
	ErrWrongTypeAssertion = ErrorType("Wrong type assertion")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	reflect.Kind
	// contains filtered or unexported fields
}

Array type for clause attribute evaluation

func NewArray

func NewArray(kind reflect.Kind, value interface{}) *Array

NewArray creates a Array instance with the object value TBD

type Boolean

type Boolean bool

Boolean type for clause attribute evaluation

func NewBoolean

func NewBoolean(value interface{}) (*Boolean, error)

NewBoolean creates a Boolean instance with the object value

func (Boolean) Contains

func (b Boolean) Contains(value []string) bool

Contains always return false

func (Boolean) EndsWith

func (b Boolean) EndsWith(value []string) bool

EndsWith always return false

func (Boolean) Equal

func (b Boolean) Equal(value []string) bool

Equal check if the boolean and value are equal

func (Boolean) EqualSensitive

func (b Boolean) EqualSensitive(value []string) bool

EqualSensitive always return false

func (Boolean) GreaterThan

func (b Boolean) GreaterThan(value []string) bool

GreaterThan always return false

func (Boolean) GreaterThanEqual

func (b Boolean) GreaterThanEqual(value []string) bool

GreaterThanEqual always return false

func (Boolean) In

func (b Boolean) In(value []string) bool

In always return false

func (Boolean) LessThan

func (b Boolean) LessThan(value []string) bool

LessThan always return false

func (Boolean) LessThanEqual

func (b Boolean) LessThanEqual(value []string) bool

LessThanEqual always return false

func (Boolean) Match

func (b Boolean) Match(value []string) bool

Match always return false

func (Boolean) StartsWith

func (b Boolean) StartsWith(value []string) bool

StartsWith always return false

type ErrorType

type ErrorType string

ErrorType is custom type for using it in const declarations

func (ErrorType) Error

func (e ErrorType) Error() string

type Integer

type Integer int64

Integer type for clause attribute evaluation

func NewInteger

func NewInteger(value interface{}) (*Integer, error)

NewInteger creates a Integer instance with the object value

func (Integer) Contains

func (n Integer) Contains([]string) bool

Contains always return false

func (Integer) EndsWith

func (n Integer) EndsWith([]string) bool

EndsWith always return false

func (Integer) Equal

func (n Integer) Equal(value []string) bool

Equal check if the number and value are equal

func (Integer) EqualSensitive

func (n Integer) EqualSensitive([]string) bool

EqualSensitive always return false

func (Integer) GreaterThan

func (n Integer) GreaterThan(value []string) bool

GreaterThan checks if the number is greater than the value

func (Integer) GreaterThanEqual

func (n Integer) GreaterThanEqual(value []string) bool

GreaterThanEqual checks if the number is greater or equal than the value

func (Integer) In

func (n Integer) In(value []string) bool

In checks if the number exist in slice of numbers (value)

func (Integer) LessThan

func (n Integer) LessThan(value []string) bool

LessThan checks if the number is less than the value

func (Integer) LessThanEqual

func (n Integer) LessThanEqual(value []string) bool

LessThanEqual checks if the number is less or equal than the value

func (Integer) Match

func (n Integer) Match([]string) bool

Match always return false

func (Integer) StartsWith

func (n Integer) StartsWith([]string) bool

StartsWith always return false

type JSON

type JSON map[string]interface{}

JSON type

type Number

type Number float64

Number type for clause attribute evaluation

func NewNumber

func NewNumber(value interface{}) (*Number, error)

NewNumber creates a Number instance with the object value

func (Number) Contains

func (n Number) Contains(value []string) bool

Contains always return false

func (Number) EndsWith

func (n Number) EndsWith(value []string) bool

EndsWith always return false

func (Number) Equal

func (n Number) Equal(value []string) bool

Equal check if the number and value are equal

func (Number) EqualSensitive

func (n Number) EqualSensitive(value []string) bool

EqualSensitive always return false

func (Number) GreaterThan

func (n Number) GreaterThan(value []string) bool

GreaterThan checks if the number is greater than the value

func (Number) GreaterThanEqual

func (n Number) GreaterThanEqual(value []string) bool

GreaterThanEqual checks if the number is greater or equal than the value

func (Number) In

func (n Number) In(value []string) bool

In checks if the number exist in slice of numbers (value)

func (Number) LessThan

func (n Number) LessThan(value []string) bool

LessThan checks if the number is less than the value

func (Number) LessThanEqual

func (n Number) LessThanEqual(value []string) bool

LessThanEqual checks if the number is less or equal than the value

func (Number) Match

func (n Number) Match(value []string) bool

Match always return false

func (Number) StartsWith

func (n Number) StartsWith(value []string) bool

StartsWith always return false

type RealClock added in v0.1.12

type RealClock struct{}

RealClock is the default implementation for Sleeper

func (RealClock) Sleep added in v0.1.12

func (rc RealClock) Sleep(d time.Duration)

type Sleeper added in v0.1.12

type Sleeper interface {
	Sleep(time.Duration)
}

type Slice

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

Slice type for clause attribute evaluation

func NewSlice

func NewSlice(value interface{}) Slice

NewSlice creates a Slice instance with the object value

func (Slice) Contains

func (s Slice) Contains(values []string) bool

Contains always return false

func (Slice) EndsWith

func (s Slice) EndsWith(value []string) bool

EndsWith always return false

func (Slice) Equal

func (s Slice) Equal(value []string) bool

Equal always return false

func (Slice) EqualSensitive

func (s Slice) EqualSensitive(value []string) bool

EqualSensitive always return false

func (Slice) GreaterThan

func (s Slice) GreaterThan(value []string) bool

GreaterThan always return false

func (Slice) GreaterThanEqual

func (s Slice) GreaterThanEqual(value []string) bool

GreaterThanEqual always return false

func (Slice) In

func (s Slice) In(values []string) bool

In compares the attributes held by the slice with the input values. it will first determine what type of slice this is, before casting values to the appropriate type.

func (Slice) LessThan

func (s Slice) LessThan(value []string) bool

LessThan always return false

func (Slice) LessThanEqual

func (s Slice) LessThanEqual(value []string) bool

LessThanEqual always return false

func (Slice) Match

func (s Slice) Match(value []string) bool

Match always return false

func (Slice) StartsWith

func (s Slice) StartsWith(value []string) bool

StartsWith always return false

type String

type String string

String type for clause attribute evaluation

func NewString

func NewString(value interface{}) (*String, error)

NewString creates a string with the object value

func (String) Contains

func (s String) Contains(value []string) bool

Contains check if the string contains the value

func (String) EndsWith

func (s String) EndsWith(value []string) bool

EndsWith check if the string ends with the value

func (String) Equal

func (s String) Equal(value []string) bool

Equal check if the string and value are equal

func (String) EqualSensitive

func (s String) EqualSensitive(value []string) bool

EqualSensitive check if the string and value are equal (case sensitive)

func (String) GreaterThan

func (s String) GreaterThan(value []string) bool

GreaterThan checks if the string is greater than the value

func (String) GreaterThanEqual

func (s String) GreaterThanEqual(value []string) bool

GreaterThanEqual checks if the string is greater or equal than the value

func (String) In

func (s String) In(value []string) bool

In checks if the string exist in slice of strings (value)

func (String) LessThan

func (s String) LessThan(value []string) bool

LessThan checks if the string is less than the value

func (String) LessThanEqual

func (s String) LessThanEqual(value []string) bool

LessThanEqual checks if the string is less or equal than the value

func (String) Match

func (s String) Match(value []string) bool

Match check if the string match the regex value

func (String) StartsWith

func (s String) StartsWith(value []string) bool

StartsWith check if the string starts with the value

func (String) String

func (s String) String() string

String implement Stringer interface

type ValueType

type ValueType interface {
	StartsWith(value []string) bool
	EndsWith(value []string) bool
	Match(value []string) bool
	Contains(value []string) bool
	EqualSensitive(value []string) bool
	Equal(value []string) bool
	GreaterThan(value []string) bool
	GreaterThanEqual(value []string) bool
	LessThan(value []string) bool
	LessThanEqual(value []string) bool
	In(value []string) bool
}

ValueType interface used for different clause types

Jump to

Keyboard shortcuts

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