jtypes

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package jtypes (golint)

Package jtypes provides types and utilities for third party extension functions.

Index

Constants

This section is empty.

Variables

View Source
var (

	// TypeOptional (golint)
	TypeOptional = reflect.TypeOf((*Optional)(nil)).Elem()
	// TypeCallable (golint)
	TypeCallable = reflect.TypeOf((*Callable)(nil)).Elem()
	// TypeConvertible (golint)
	TypeConvertible = reflect.TypeOf((*Convertible)(nil)).Elem()
	// TypeVariant (golint)
	TypeVariant = reflect.TypeOf((*Variant)(nil)).Elem()
	// TypeValue (golint)
	TypeValue = reflect.TypeOf((*reflect.Value)(nil)).Elem()
	// TypeInterface (golint)
	TypeInterface = reflect.TypeOf((*interface{})(nil)).Elem()
)
View Source
var ErrUndefined = errors.New("undefined")

ErrUndefined (golint)

Functions

func AsBool

func AsBool(v reflect.Value) (bool, bool)

AsBool (golint)

func AsNumber

func AsNumber(v reflect.Value) (float64, bool)

AsNumber (golint)

func AsString

func AsString(v reflect.Value) (string, bool)

AsString (golint)

func IsArray

func IsArray(v reflect.Value) bool

IsArray (golint)

func IsArrayOf

func IsArrayOf(v reflect.Value, hasType func(reflect.Value) bool) bool

IsArrayOf (golint)

func IsBool

func IsBool(v reflect.Value) bool

IsBool (golint)

func IsCallable

func IsCallable(v reflect.Value) bool

IsCallable (golint)

func IsMap

func IsMap(v reflect.Value) bool

IsMap (golint)

func IsNumber

func IsNumber(v reflect.Value) bool

IsNumber (golint)

func IsString

func IsString(v reflect.Value) bool

IsString (golint)

func IsStruct

func IsStruct(v reflect.Value) bool

IsStruct (golint)

func Resolve

func Resolve(v reflect.Value) reflect.Value

Resolve (golint)

Types

type ArgHandler

type ArgHandler func([]reflect.Value) bool

ArgHandler (golint)

func ArgCountEquals

func ArgCountEquals(n int) ArgHandler

ArgCountEquals (golint)

func ArgUndefined

func ArgUndefined(i int) ArgHandler

ArgUndefined (golint)

type Callable

type Callable interface {
	Name() string
	ParamCount() int
	Call([]reflect.Value) (reflect.Value, error)
}

Callable (golint)

func AsCallable

func AsCallable(v reflect.Value) (Callable, bool)

AsCallable (golint)

type Convertible

type Convertible interface {
	ConvertTo(reflect.Type) (reflect.Value, bool)
}

Convertible (golint)

type Optional

type Optional interface {
	IsSet() bool
	Set(reflect.Value)
	Type() reflect.Type
}

Optional (golint)

type OptionalBool

type OptionalBool struct {
	Bool bool
	// contains filtered or unexported fields
}

OptionalBool (golint)

func NewOptionalBool

func NewOptionalBool(value bool) OptionalBool

NewOptionalBool (golint)

func (*OptionalBool) IsSet

func (opt *OptionalBool) IsSet() bool

IsSet (golint)

func (*OptionalBool) Set

func (opt *OptionalBool) Set(v reflect.Value)

Set (golint)

func (*OptionalBool) Type

func (opt *OptionalBool) Type() reflect.Type

Type (golint)

type OptionalCallable

type OptionalCallable struct {
	Callable Callable
	// contains filtered or unexported fields
}

OptionalCallable (golint)

func NewOptionalCallable

func NewOptionalCallable(value Callable) OptionalCallable

NewOptionalCallable (golint)

func (*OptionalCallable) IsSet

func (opt *OptionalCallable) IsSet() bool

IsSet (golint)

func (*OptionalCallable) Set

func (opt *OptionalCallable) Set(v reflect.Value)

Set (golint)

func (*OptionalCallable) Type

func (opt *OptionalCallable) Type() reflect.Type

Type (golint)

type OptionalFloat64

type OptionalFloat64 struct {
	Float64 float64
	// contains filtered or unexported fields
}

OptionalFloat64 (golint)

func NewOptionalFloat64

func NewOptionalFloat64(value float64) OptionalFloat64

NewOptionalFloat64 (golint)

func (*OptionalFloat64) IsSet

func (opt *OptionalFloat64) IsSet() bool

IsSet (golint)

func (*OptionalFloat64) Set

func (opt *OptionalFloat64) Set(v reflect.Value)

Set (golint)

func (*OptionalFloat64) Type

func (opt *OptionalFloat64) Type() reflect.Type

Type (golint)

type OptionalInt

type OptionalInt struct {
	Int int
	// contains filtered or unexported fields
}

OptionalInt (golint)

func NewOptionalInt

func NewOptionalInt(value int) OptionalInt

NewOptionalInt (golint)

func (*OptionalInt) IsSet

func (opt *OptionalInt) IsSet() bool

IsSet (golint)

func (*OptionalInt) Set

func (opt *OptionalInt) Set(v reflect.Value)

Set (golint)

func (*OptionalInt) Type

func (opt *OptionalInt) Type() reflect.Type

Type (golint)

type OptionalInterface

type OptionalInterface struct {
	Interface interface{}
	// contains filtered or unexported fields
}

OptionalInterface (golint)

func NewOptionalInterface

func NewOptionalInterface(value interface{}) OptionalInterface

NewOptionalInterface (golint)

func (*OptionalInterface) IsSet

func (opt *OptionalInterface) IsSet() bool

IsSet (golint)

func (*OptionalInterface) Set

func (opt *OptionalInterface) Set(v reflect.Value)

Set (golint)

func (*OptionalInterface) Type

func (opt *OptionalInterface) Type() reflect.Type

Type (golint)

type OptionalString

type OptionalString struct {
	String string
	// contains filtered or unexported fields
}

OptionalString (golint)

func NewOptionalString

func NewOptionalString(value string) OptionalString

NewOptionalString (golint)

func (*OptionalString) IsSet

func (opt *OptionalString) IsSet() bool

IsSet (golint)

func (*OptionalString) Set

func (opt *OptionalString) Set(v reflect.Value)

Set (golint)

func (*OptionalString) Type

func (opt *OptionalString) Type() reflect.Type

Type (golint)

type OptionalValue

type OptionalValue struct {
	Value reflect.Value
	// contains filtered or unexported fields
}

OptionalValue (golint)

func NewOptionalValue

func NewOptionalValue(value reflect.Value) OptionalValue

NewOptionalValue (golint)

func (*OptionalValue) IsSet

func (opt *OptionalValue) IsSet() bool

IsSet (golint)

func (*OptionalValue) Set

func (opt *OptionalValue) Set(v reflect.Value)

Set (golint)

func (*OptionalValue) Type

func (opt *OptionalValue) Type() reflect.Type

Type (golint)

type Variant

type Variant interface {
	ValidTypes() []reflect.Type
}

Variant (golint)

Jump to

Keyboard shortcuts

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