Documentation
¶
Index ¶
- Variables
- func Implements[T any](typ reflect.Type) bool
- func TryCast[T any](v reflect.Value) (def T, ok bool)
- func TryUnwrap[T any](v ipld.Node) (def T, ok bool)
- func Unwrap(v ipld.Node) any
- func Wrap(v any) ipld.Node
- type BinaryOperator
- type Field
- type ListType
- type MapType
- type Operator
- type OperatorName
- type PrimitiveKind
- type StructType
- type Type
- type TypeName
- func (n TypeName) FullName() string
- func (n TypeName) GoString() string
- func (n TypeName) NormalizedFullNameWithArguments() string
- func (n TypeName) String() string
- func (n TypeName) ToTitle() string
- func (n TypeName) ToTitlePlural() string
- func (n TypeName) WithParameters(parameters ...TypeName) TypeName
- type TypeSystem
- type TypedLink
- type UnaryOperator
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidType = errors.New("invalid type")
Functions ¶
Types ¶
type BinaryOperator ¶
type Operator ¶
type Operator interface {
Name() OperatorName
Commutator() OperatorName
Negator() OperatorName
ReceiverType() Type
Parameters() []Type
Call(args ...Value) (Value, error)
}
type OperatorName ¶
type OperatorName string
const ( OperatorInvalid OperatorName = "" OperatorAdd OperatorName = "+" OperatorSub OperatorName = "-" OperatorMul OperatorName = "*" OperatorDiv OperatorName = "/" OperatorRem OperatorName = "%" OperatorAnd OperatorName = "&&" OperatorOr OperatorName = "||" OperatorNot OperatorName = "!" OperatorEq OperatorName = "==" OperatorNeq OperatorName = "!=" OperatorNe OperatorName = "!=" OperatorLt OperatorName = "<" OperatorGt OperatorName = ">" OperatorLe OperatorName = "<=" OperatorGe OperatorName = ">=" )
type PrimitiveKind ¶
type PrimitiveKind int
const ( PrimitiveKindInvalid PrimitiveKind = iota PrimitiveKindBoolean PrimitiveKindBytes PrimitiveKindString PrimitiveKindInt PrimitiveKindUnsignedInt PrimitiveKindFloat PrimitiveKindList PrimitiveKindMap PrimitiveKindStruct PrimitiveKindInterface PrimitiveKindLink )
type StructType ¶
type Type ¶
type Type interface {
Name() TypeName
PrimitiveKind() PrimitiveKind
RuntimeType() reflect.Type
IpldType() schema.Type
IpldPrimitive() ipld.NodePrototype
IpldPrototype() schema.TypedPrototype
IpldRepresentationKind() datamodel.Kind
Struct() StructType
List() ListType
Map() MapType
}
type TypeName ¶
func (TypeName) NormalizedFullNameWithArguments ¶
func (TypeName) ToTitlePlural ¶
func (TypeName) WithParameters ¶
type TypeSystem ¶
type TypeSystem struct {
// contains filtered or unexported fields
}
func Universe ¶
func Universe() *TypeSystem
func (*TypeSystem) LookupByName ¶
func (ts *TypeSystem) LookupByName(name string) Type
func (*TypeSystem) LookupByType ¶
func (ts *TypeSystem) LookupByType(typ reflect.Type) Type
func (*TypeSystem) Register ¶
func (ts *TypeSystem) Register(t Type)
type UnaryOperator ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (Value) RuntimeType ¶
Click to show internal directories.
Click to hide internal directories.