types

package
v0.0.0-...-da1d25d Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanicOnError

func PanicOnError(err error)

Types

type Boolean

type Boolean bool

func (Boolean) Cast

func (b Boolean) Cast(toPtr interface{})

func (Boolean) Compare

func (b Boolean) Compare(other TypedValue) TypeComparision

func (Boolean) Equals

func (b Boolean) Equals(other TypedValue) bool

func (Boolean) Kind

func (b Boolean) Kind() TypeKind

func (Boolean) NativeType

func (b Boolean) NativeType() interface{}

func (Boolean) Precedence

func (b Boolean) Precedence() int

func (Boolean) Ptr

func (b Boolean) Ptr() TypedValue

func (Boolean) String

func (b Boolean) String() string

type Datetime

type Datetime time.Time

func (Datetime) Cast

func (i Datetime) Cast(toPtr interface{})

func (Datetime) Compare

func (i Datetime) Compare(other TypedValue) TypeComparision

func (Datetime) Equals

func (i Datetime) Equals(other TypedValue) bool

func (Datetime) Kind

func (i Datetime) Kind() TypeKind

func (Datetime) NativeType

func (i Datetime) NativeType() interface{}

func (Datetime) Precedence

func (i Datetime) Precedence() int

func (Datetime) Ptr

func (i Datetime) Ptr() TypedValue

func (Datetime) String

func (i Datetime) String() string

type Decimal

type Decimal float64

func (Decimal) Cast

func (i Decimal) Cast(toPtr interface{})

func (Decimal) Compare

func (i Decimal) Compare(other TypedValue) TypeComparision

func (Decimal) Equals

func (i Decimal) Equals(other TypedValue) bool

func (Decimal) Kind

func (i Decimal) Kind() TypeKind

func (Decimal) NativeType

func (i Decimal) NativeType() interface{}

func (Decimal) Precedence

func (i Decimal) Precedence() int

func (Decimal) Ptr

func (i Decimal) Ptr() TypedValue

func (Decimal) String

func (i Decimal) String() string

type Integer

type Integer int64

func (Integer) Cast

func (i Integer) Cast(toPtr interface{})

func (Integer) Compare

func (i Integer) Compare(other TypedValue) TypeComparision

func (Integer) Equals

func (i Integer) Equals(other TypedValue) bool

func (Integer) Kind

func (i Integer) Kind() TypeKind

func (Integer) NativeType

func (i Integer) NativeType() interface{}

func (Integer) Precedence

func (i Integer) Precedence() int

func (Integer) Ptr

func (i Integer) Ptr() TypedValue

func (Integer) String

func (i Integer) String() string

type MissingValue

type MissingValue struct{}
var Missing MissingValue

func (MissingValue) Cast

func (m MissingValue) Cast(toPtr interface{})

func (MissingValue) Compare

func (m MissingValue) Compare(other TypedValue) TypeComparision

func (MissingValue) Equals

func (m MissingValue) Equals(other TypedValue) bool

func (MissingValue) Kind

func (m MissingValue) Kind() TypeKind

func (MissingValue) NativeType

func (b MissingValue) NativeType() interface{}

func (MissingValue) Precedence

func (m MissingValue) Precedence() int

func (MissingValue) Ptr

func (m MissingValue) Ptr() TypedValue

func (MissingValue) String

func (m MissingValue) String() string

type String

type String string

func (String) Cast

func (i String) Cast(toPtr interface{})

func (String) Compare

func (i String) Compare(other TypedValue) TypeComparision

func (String) Equals

func (i String) Equals(other TypedValue) bool

func (String) Kind

func (i String) Kind() TypeKind

func (String) NativeType

func (i String) NativeType() interface{}

func (String) Precedence

func (i String) Precedence() int

func (String) Ptr

func (i String) Ptr() TypedValue

func (String) String

func (i String) String() string

type TypeComparision

type TypeComparision int
const (
	Equals        TypeComparision = 0
	LeftIsBigger  TypeComparision = 1
	RightIsBigger TypeComparision = -1
)

type TypeKind

type TypeKind string
const (
	KindBoolean  TypeKind = "Boolean"
	KindInteger  TypeKind = "Integer"
	KindDecimal  TypeKind = "Decimal"
	KindString   TypeKind = "String"
	KindDatetime TypeKind = "Datetime"

	KindMissing TypeKind = "KindMissing"
	KindUnknown TypeKind = "KindUnknown"
)

func MatchKind

func MatchKind(value interface{}) TypeKind

type TypedValue

type TypedValue interface {
	fmt.Stringer
	Equals(other TypedValue) bool
	Compare(other TypedValue) TypeComparision
	Cast(toPtr interface{})
	Kind() TypeKind
	Ptr() TypedValue
	NativeType() interface{}
	Precedence() int
}

func AutoCast

func AutoCast(from TypedValue, to TypeKind) TypedValue

func Convert

func Convert(value interface{}, kind TypeKind) TypedValue

Jump to

Keyboard shortcuts

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