Documentation
¶
Overview ¶
Example (NextToken) ¶
const src = `# This is scanned code. constants => { first => 0, second => 0x32, third => 2e4, fourth => 2.3e-2, fifth => 'hello', sixth => "world", type => Foo::Bar, value => "String\nWith \\Escape", array => [a, b, c], call => Boo::Bar(x, 3) }` sr := utils.NewStringReader(src) for { tf := nextToken(sr) if tf.i == end { break } fmt.Println(tf) }
Output: identifier: 'constants' rocket: '=>' leftCurlyBrace: '{' identifier: 'first' rocket: '=>' integer: '0' comma: ',' identifier: 'second' rocket: '=>' integer: '0x32' comma: ',' identifier: 'third' rocket: '=>' float: '2e4' comma: ',' identifier: 'fourth' rocket: '=>' float: '2.3e-2' comma: ',' identifier: 'fifth' rocket: '=>' string: 'hello' comma: ',' identifier: 'sixth' rocket: '=>' string: 'world' comma: ',' identifier: 'type' rocket: '=>' name: 'Foo::Bar' comma: ',' identifier: 'value' rocket: '=>' string: 'String With \Escape' comma: ',' identifier: 'array' rocket: '=>' leftBracket: '[' identifier: 'a' comma: ',' identifier: 'b' comma: ',' identifier: 'c' rightBracket: ']' comma: ',' identifier: 'call' rocket: '=>' name: 'Boo::Bar' leftParen: '(' identifier: 'x' comma: ',' integer: '3' rightParen: ')' rightCurlyBrace: '}'
Index ¶
- Constants
- Variables
- func AllocObjectType() *objectType
- func AllocObjectValue(typ px.ObjectType) px.Object
- func AllocTypeSetType() *typeSet
- func BuildObjectType(name string, parent px.Type, hashProducer func(px.ObjectType) px.OrderedMap) px.ObjectType
- func CanCoerce(typ px.Type, value px.Value) bool
- func CoerceTo(c px.Context, label string, typ px.Type, value px.Value) (result px.Value)
- func CopyAppend(types []px.Type, t px.Type) []px.Type
- func DefaultAnnotationType() px.Type
- func DefaultObjectType() *objectType
- func DefaultStringType() *stringType
- func DefaultTypeSetType() px.TypeSet
- func EachCoreType(fc func(t px.Type))
- func FieldName(f *reflect.StructField) string
- func Fields(t reflect.Type) []reflect.StructField
- func FormatFromHash(h *Hash) px.Format
- func GuardedIsAssignable(a px.Type, b px.Type, g px.Guard) bool
- func GuardedIsInstance(a px.Type, v px.Value, g px.Guard) bool
- func LazyIsInstance(a px.Type, b px.Value, g px.Guard) int
- func MakeObjectType(name string, parent px.Type, initHash px.OrderedMap, register bool, ...) *objectType
- func MapToRegexps(regexpTypes []*RegexpType) []*regexp.Regexp
- func Methods(t reflect.Type) []reflect.Method
- func NamedType(na px.URI, name string, value px.Value) px.Type
- func NewCollector() px.Collector
- func NewDeferred(name string, arguments ...px.Value) *deferred
- func NewFormatMap(h *Hash) px.FormatMap
- func NewObjectTypeExtension(c px.Context, baseType px.ObjectType, initParameters []px.Value) *objectTypeExtension
- func NewObjectValue(c px.Context, typ px.ObjectType, values []px.Value) (ov px.Object)
- func NewReflectedValue(typ px.ObjectType, value reflect.Value) px.Object
- func NewReflector(c px.Context) px.Reflector
- func NewStringType(rng *IntegerType, s string) px.Type
- func NewTagsAnnotation(tags px.OrderedMap) px.TagsAnnotation
- func NewTypeSet(na px.URI, name string, initHash px.OrderedMap) px.TypeSet
- func NewTypedName(namespace px.Namespace, name string) px.TypedName
- func NewVariantType(types ...px.Type) px.Type
- func NilAs(dflt, t px.Type) px.Type
- func NormalizeType(rt reflect.Type) reflect.Type
- func ObjectToString(o px.PuppetObject, s px.FormatContext, b io.Writer, g px.RDetect)
- func ParentType(t reflect.Type) reflect.Type
- func Parse(content string) px.Value
- func ParseFile(fileName, content string) px.Value
- func ParseTagHash(tag string) (px.OrderedMap, bool)
- func ParseTags(tag string) map[string]string
- func ParseURI(str string) *url.URL
- func ParseURI2(str string, strict bool) (*url.URL, error)
- func PopDeclaredTypes() (types []px.ResolvableType)
- func PrimitivePType(vt reflect.Type) (pt px.Type, ok bool)
- func PuppetFprintf(buf io.Writer, s string, args ...px.Value)
- func PuppetSprintf(s string, args ...px.Value) string
- func ReflectType(c px.Context, src px.Type) (reflect.Type, bool)
- func Resolve(c px.Context, tn string) px.Type
- func ResolveDeferred(c px.Context, a px.Value, scope px.Keyed) px.Value
- func ResolveWithParams(c px.Context, name string, args []px.Value) px.Type
- func TagHash(f *reflect.StructField) (px.OrderedMap, bool)
- func TimeFromHash(hash *Hash) (time.Time, bool)
- func TimeFromString(value string) time.Time
- func TypeToString(t px.Type, b io.Writer, s px.FormatContext, g px.RDetect)
- func URIFromHash(hash *Hash) *url.URL
- func UniqueTypes(types []px.Type) []px.Type
- func UniqueValues(values []px.Value) []px.Value
- func ValueSlice(slice interface{}) []px.Value
- func WrapBoolean(val bool) px.Boolean
- func WrapFloat(val float64) px.Float
- func WrapInteger(val int64) px.Integer
- func WrapPrimitive(vr reflect.Value) (pv px.Value, ok bool)
- func WrapString(str string) px.StringValue
- type AnyType
- func (t *AnyType) Accept(v px.Visitor, g px.Guard)
- func (t *AnyType) CanSerializeAsString() bool
- func (t *AnyType) Equals(o interface{}, g px.Guard) bool
- func (t *AnyType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *AnyType) IsInstance(v px.Value, g px.Guard) bool
- func (t *AnyType) MetaType() px.ObjectType
- func (t *AnyType) Name() string
- func (t *AnyType) PType() px.Type
- func (t *AnyType) SerializationString() string
- func (t *AnyType) String() string
- func (t *AnyType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Array
- func BuildArray(len int, bld func(*Array, []px.Value) []px.Value) *Array
- func SingletonArray(element px.Value) *Array
- func WrapArray3(iv px.List) *Array
- func WrapInterfaces(c px.Context, elements []interface{}) *Array
- func WrapInts(ints []int) *Array
- func WrapStrings(strings []string) *Array
- func WrapTypes(elements []px.Type) *Array
- func WrapValues(elements []px.Value) *Array
- func (av *Array) Add(ov px.Value) px.List
- func (av *Array) AddAll(ov px.List) px.List
- func (av *Array) All(predicate px.Predicate) bool
- func (av *Array) Any(predicate px.Predicate) bool
- func (av *Array) AppendTo(slice []px.Value) []px.Value
- func (av *Array) At(i int) px.Value
- func (av *Array) Delete(ov px.Value) px.List
- func (av *Array) DeleteAll(ov px.List) px.List
- func (av *Array) DetailedType() px.Type
- func (av *Array) Dig(into px.Value) px.Value
- func (av *Array) Each(consumer px.Consumer)
- func (av *Array) EachSlice(n int, consumer px.SliceConsumer)
- func (av *Array) EachWithIndex(consumer px.IndexedConsumer)
- func (av *Array) ElementType() px.Type
- func (av *Array) Equals(o interface{}, g px.Guard) bool
- func (av *Array) Find(predicate px.Predicate) (px.Value, bool)
- func (av *Array) Flatten() px.List
- func (av *Array) IsEmpty() bool
- func (av *Array) IsHashStyle() bool
- func (av *Array) Len() int
- func (av *Array) Map(mapper px.Mapper) px.List
- func (av *Array) PType() px.Type
- func (av *Array) Reduce(redactor px.BiMapper) px.Value
- func (av *Array) Reduce2(initialValue px.Value, redactor px.BiMapper) px.Value
- func (av *Array) Reflect(c px.Context) reflect.Value
- func (av *Array) ReflectTo(c px.Context, value reflect.Value)
- func (av *Array) Reject(predicate px.Predicate) px.List
- func (av *Array) Select(predicate px.Predicate) px.List
- func (av *Array) Slice(i int, j int) px.List
- func (av *Array) Sort(comparator px.Comparator) px.List
- func (av *Array) String() string
- func (av *Array) ToKey(b *bytes.Buffer)
- func (av *Array) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (av *Array) ToString2(b io.Writer, s px.FormatContext, f px.Format, delim byte, g px.RDetect)
- func (av *Array) Unique() px.List
- type ArrayType
- func (t *ArrayType) Accept(v px.Visitor, g px.Guard)
- func (t *ArrayType) CanSerializeAsString() bool
- func (t *ArrayType) Default() px.Type
- func (t *ArrayType) ElementType() px.Type
- func (t *ArrayType) Equals(o interface{}, g px.Guard) bool
- func (t *ArrayType) Generic() px.Type
- func (t *ArrayType) Get(key string) (value px.Value, ok bool)
- func (t *ArrayType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *ArrayType) IsInstance(v px.Value, g px.Guard) bool
- func (t *ArrayType) MetaType() px.ObjectType
- func (t *ArrayType) Name() string
- func (t *ArrayType) PType() px.Type
- func (t *ArrayType) Parameters() []px.Value
- func (t *ArrayType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *ArrayType) Resolve(c px.Context) px.Type
- func (t *ArrayType) SerializationString() string
- func (t *ArrayType) Size() *IntegerType
- func (t *ArrayType) String() string
- func (t *ArrayType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type BasicCollector
- func (hm *BasicCollector) Add(element px.Value)
- func (hm *BasicCollector) AddArray(cap int, doer px.Doer)
- func (hm *BasicCollector) AddHash(cap int, doer px.Doer)
- func (hm *BasicCollector) AddRef(ref int)
- func (hm *BasicCollector) CanDoBinary() bool
- func (hm *BasicCollector) CanDoComplexKeys() bool
- func (hm *BasicCollector) Init()
- func (hm *BasicCollector) PopLast() px.Value
- func (hm *BasicCollector) StringDedupThreshold() int
- func (hm *BasicCollector) Value() px.Value
- type Binary
- func (bv *Binary) AsArray() px.List
- func (bv *Binary) Bytes() []byte
- func (bv *Binary) CanSerializeAsString() bool
- func (bv *Binary) Equals(o interface{}, g px.Guard) bool
- func (bv *Binary) PType() px.Type
- func (bv *Binary) Reflect(c px.Context) reflect.Value
- func (bv *Binary) ReflectTo(c px.Context, value reflect.Value)
- func (bv *Binary) SerializationString() string
- func (bv *Binary) String() string
- func (bv *Binary) ToKey(b *bytes.Buffer)
- func (bv *Binary) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type BinaryType
- func (t *BinaryType) Accept(v px.Visitor, g px.Guard)
- func (t *BinaryType) CanSerializeAsString() bool
- func (t *BinaryType) Equals(o interface{}, g px.Guard) bool
- func (t *BinaryType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *BinaryType) IsInstance(o px.Value, g px.Guard) bool
- func (t *BinaryType) MetaType() px.ObjectType
- func (t *BinaryType) Name() string
- func (t *BinaryType) PType() px.Type
- func (t *BinaryType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *BinaryType) SerializationString() string
- func (t *BinaryType) String() string
- func (t *BinaryType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type BooleanType
- func (t *BooleanType) Accept(v px.Visitor, g px.Guard)
- func (t *BooleanType) CanSerializeAsString() bool
- func (t *BooleanType) Default() px.Type
- func (t *BooleanType) Equals(o interface{}, g px.Guard) bool
- func (t *BooleanType) Generic() px.Type
- func (t *BooleanType) Get(key string) (px.Value, bool)
- func (t *BooleanType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *BooleanType) IsInstance(o px.Value, g px.Guard) bool
- func (t *BooleanType) MetaType() px.ObjectType
- func (t *BooleanType) Name() string
- func (t *BooleanType) PType() px.Type
- func (t *BooleanType) Parameters() []px.Value
- func (t *BooleanType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *BooleanType) SerializationString() string
- func (t *BooleanType) String() string
- func (t *BooleanType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type BuildFunctionArgs
- type CallableType
- func (t *CallableType) Accept(v px.Visitor, g px.Guard)
- func (t *CallableType) BlockName() string
- func (t *CallableType) BlockType() px.Type
- func (t *CallableType) CallableWith(args []px.Value, block px.Lambda) bool
- func (t *CallableType) CanSerializeAsString() bool
- func (t *CallableType) Default() px.Type
- func (t *CallableType) Equals(o interface{}, g px.Guard) bool
- func (t *CallableType) Generic() px.Type
- func (t *CallableType) Get(key string) (px.Value, bool)
- func (t *CallableType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *CallableType) IsInstance(o px.Value, g px.Guard) bool
- func (t *CallableType) MetaType() px.ObjectType
- func (t *CallableType) Name() string
- func (t *CallableType) PType() px.Type
- func (t *CallableType) ParameterNames() []string
- func (t *CallableType) Parameters() (params []px.Value)
- func (t *CallableType) ParametersType() px.Type
- func (t *CallableType) Resolve(c px.Context) px.Type
- func (t *CallableType) ReturnType() px.Type
- func (t *CallableType) SerializationString() string
- func (t *CallableType) String() string
- func (t *CallableType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type CollectionType
- func (t *CollectionType) Accept(v px.Visitor, g px.Guard)
- func (t *CollectionType) CanSerializeAsString() bool
- func (t *CollectionType) Default() px.Type
- func (t *CollectionType) Equals(o interface{}, g px.Guard) bool
- func (t *CollectionType) Generic() px.Type
- func (t *CollectionType) Get(key string) (px.Value, bool)
- func (t *CollectionType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *CollectionType) IsInstance(o px.Value, g px.Guard) bool
- func (t *CollectionType) MetaType() px.ObjectType
- func (t *CollectionType) Name() string
- func (t *CollectionType) PType() px.Type
- func (t *CollectionType) Parameters() []px.Value
- func (t *CollectionType) SerializationString() string
- func (t *CollectionType) Size() *IntegerType
- func (t *CollectionType) String() string
- func (t *CollectionType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type DefaultType
- func (t *DefaultType) Accept(v px.Visitor, g px.Guard)
- func (t *DefaultType) CanSerializeAsString() bool
- func (t *DefaultType) Equals(o interface{}, g px.Guard) bool
- func (t *DefaultType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *DefaultType) IsInstance(o px.Value, g px.Guard) bool
- func (t *DefaultType) MetaType() px.ObjectType
- func (t *DefaultType) Name() string
- func (t *DefaultType) PType() px.Type
- func (t *DefaultType) SerializationString() string
- func (t *DefaultType) String() string
- func (t *DefaultType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type DefaultValue
- type Deferred
- type DeferredType
- func (dt *DeferredType) Equals(other interface{}, guard px.Guard) bool
- func (dt *DeferredType) Name() string
- func (dt *DeferredType) PType() px.Type
- func (dt *DeferredType) Parameters() []px.Value
- func (dt *DeferredType) Resolve(c px.Context) px.Type
- func (dt *DeferredType) String() string
- func (dt *DeferredType) ToString(bld io.Writer, s px.FormatContext, g px.RDetect)
- type EnumType
- func (t *EnumType) Accept(v px.Visitor, g px.Guard)
- func (t *EnumType) CanSerializeAsString() bool
- func (t *EnumType) Default() px.Type
- func (t *EnumType) Equals(o interface{}, g px.Guard) bool
- func (t *EnumType) Generic() px.Type
- func (t *EnumType) Get(key string) (px.Value, bool)
- func (t *EnumType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *EnumType) IsCaseInsensitive() bool
- func (t *EnumType) IsInstance(o px.Value, g px.Guard) bool
- func (t *EnumType) MetaType() px.ObjectType
- func (t *EnumType) Name() string
- func (t *EnumType) PType() px.Type
- func (t *EnumType) Parameters() []px.Value
- func (t *EnumType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *EnumType) SerializationString() string
- func (t *EnumType) String() string
- func (t *EnumType) Strings() []string
- func (t *EnumType) ToString(b io.Writer, f px.FormatContext, g px.RDetect)
- type FloatType
- func (t *FloatType) Accept(v px.Visitor, g px.Guard)
- func (t *FloatType) CanSerializeAsString() bool
- func (t *FloatType) Default() px.Type
- func (t *FloatType) Equals(o interface{}, g px.Guard) bool
- func (t *FloatType) Generic() px.Type
- func (t *FloatType) Get(key string) (px.Value, bool)
- func (t *FloatType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *FloatType) IsInstance(o px.Value, g px.Guard) bool
- func (t *FloatType) IsUnbounded() bool
- func (t *FloatType) Max() float64
- func (t *FloatType) MetaType() px.ObjectType
- func (t *FloatType) Min() float64
- func (t *FloatType) Name() string
- func (t *FloatType) PType() px.Type
- func (t *FloatType) Parameters() []px.Value
- func (t *FloatType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *FloatType) SerializationString() string
- func (t *FloatType) String() string
- func (t *FloatType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Hash
- func BuildHash(len int, bld func(*Hash, []*HashEntry) []*HashEntry) *Hash
- func IndexedFromArray(a *Array) *Hash
- func WrapHash(entries []*HashEntry) *Hash
- func WrapHash2(entries px.List) *Hash
- func WrapHashFromArray(a *Array) *Hash
- func WrapStringPValue(hash hash.StringHash) *Hash
- func WrapStringToInterfaceMap(c px.Context, hash map[string]interface{}) *Hash
- func WrapStringToStringMap(hash map[string]string) *Hash
- func WrapStringToTypeMap(hash map[string]px.Type) *Hash
- func WrapStringToValueMap(hash map[string]px.Value) *Hash
- func (hv *Hash) Add(v px.Value) px.List
- func (hv *Hash) AddAll(v px.List) px.List
- func (hv *Hash) All(predicate px.Predicate) bool
- func (hv *Hash) AllKeysAreStrings() bool
- func (hv *Hash) AllPairs(predicate px.BiPredicate) bool
- func (hv *Hash) Any(predicate px.Predicate) bool
- func (hv *Hash) AnyPair(predicate px.BiPredicate) bool
- func (hv *Hash) AppendEntriesTo(entries []*HashEntry) []*HashEntry
- func (hv *Hash) AppendTo(slice []px.Value) []px.Value
- func (hv *Hash) AsArray() px.List
- func (hv *Hash) At(i int) px.Value
- func (hv *Hash) Delete(key px.Value) px.List
- func (hv *Hash) DeleteAll(keys px.List) px.List
- func (hv *Hash) DetailedType() px.Type
- func (hv *Hash) Each(consumer px.Consumer)
- func (hv *Hash) EachKey(consumer px.Consumer)
- func (hv *Hash) EachPair(consumer px.BiConsumer)
- func (hv *Hash) EachSlice(n int, consumer px.SliceConsumer)
- func (hv *Hash) EachValue(consumer px.Consumer)
- func (hv *Hash) EachWithIndex(consumer px.IndexedConsumer)
- func (hv *Hash) ElementType() px.Type
- func (hv *Hash) Entries() px.List
- func (hv *Hash) Equals(o interface{}, g px.Guard) bool
- func (hv *Hash) Find(predicate px.Predicate) (px.Value, bool)
- func (hv *Hash) Flatten() px.List
- func (hv *Hash) Get(key px.Value) (px.Value, bool)
- func (hv *Hash) Get2(key px.Value, dflt px.Value) px.Value
- func (hv *Hash) Get3(key px.Value, dflt px.Producer) px.Value
- func (hv *Hash) Get4(key string) (px.Value, bool)
- func (hv *Hash) Get5(key string, dflt px.Value) px.Value
- func (hv *Hash) Get6(key string, dflt px.Producer) px.Value
- func (hv *Hash) GetEntry(key string) (px.MapEntry, bool)
- func (hv *Hash) GetEntryFold(key string) (px.MapEntry, bool)
- func (hv *Hash) IncludesKey(o px.Value) bool
- func (hv *Hash) IncludesKey2(key string) bool
- func (hv *Hash) IsEmpty() bool
- func (hv *Hash) IsHashStyle() bool
- func (hv *Hash) Keys() px.List
- func (hv *Hash) Len() int
- func (hv *Hash) Map(mapper px.Mapper) px.List
- func (hv *Hash) MapEntries(mapper px.EntryMapper) px.OrderedMap
- func (hv *Hash) MapValues(mapper px.Mapper) px.OrderedMap
- func (hv *Hash) Merge(o px.OrderedMap) px.OrderedMap
- func (hv *Hash) PType() px.Type
- func (hv *Hash) Reduce(redactor px.BiMapper) px.Value
- func (hv *Hash) Reduce2(initialValue px.Value, redactor px.BiMapper) px.Value
- func (hv *Hash) Reflect(c px.Context) reflect.Value
- func (hv *Hash) ReflectTo(c px.Context, value reflect.Value)
- func (hv *Hash) Reject(predicate px.Predicate) px.List
- func (hv *Hash) RejectPairs(predicate px.BiPredicate) px.OrderedMap
- func (hv *Hash) Select(predicate px.Predicate) px.List
- func (hv *Hash) SelectPairs(predicate px.BiPredicate) px.OrderedMap
- func (hv *Hash) Slice(i int, j int) px.List
- func (hv *Hash) Sort(comparator px.Comparator) px.List
- func (hv *Hash) String() string
- func (hv *Hash) ToKey(b *bytes.Buffer)
- func (hv *Hash) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (hv *Hash) ToString2(b io.Writer, s px.FormatContext, f px.Format, delim byte, g px.RDetect)
- func (hv *Hash) ToStringMap() map[string]px.Value
- func (hv *Hash) Unique() px.List
- func (hv *Hash) Values() px.List
- type HashEntry
- func (he *HashEntry) Add(v px.Value) px.List
- func (he *HashEntry) AddAll(v px.List) px.List
- func (he *HashEntry) All(predicate px.Predicate) bool
- func (he *HashEntry) Any(predicate px.Predicate) bool
- func (he *HashEntry) AppendTo(slice []px.Value) []px.Value
- func (he *HashEntry) AsArray() px.List
- func (he *HashEntry) At(i int) px.Value
- func (he *HashEntry) Delete(v px.Value) px.List
- func (he *HashEntry) DeleteAll(v px.List) px.List
- func (he *HashEntry) DetailedType() px.Type
- func (he *HashEntry) Each(consumer px.Consumer)
- func (he *HashEntry) EachSlice(n int, consumer px.SliceConsumer)
- func (he *HashEntry) EachWithIndex(consumer px.IndexedConsumer)
- func (he *HashEntry) ElementType() px.Type
- func (he *HashEntry) Equals(o interface{}, g px.Guard) bool
- func (he *HashEntry) Find(predicate px.Predicate) (px.Value, bool)
- func (he *HashEntry) Flatten() px.List
- func (he *HashEntry) IsEmpty() bool
- func (he *HashEntry) IsHashStyle() bool
- func (he *HashEntry) Key() px.Value
- func (he *HashEntry) Len() int
- func (he *HashEntry) Map(mapper px.Mapper) px.List
- func (he *HashEntry) PType() px.Type
- func (he *HashEntry) Reduce(redactor px.BiMapper) px.Value
- func (he *HashEntry) Reduce2(initialValue px.Value, redactor px.BiMapper) px.Value
- func (he *HashEntry) Reject(predicate px.Predicate) px.List
- func (he *HashEntry) Select(predicate px.Predicate) px.List
- func (he *HashEntry) Slice(i int, j int) px.List
- func (he *HashEntry) String() string
- func (he *HashEntry) ToKey(b *bytes.Buffer)
- func (he *HashEntry) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (he *HashEntry) Unique() px.List
- func (he *HashEntry) Value() px.Value
- type HashType
- func (t *HashType) Accept(v px.Visitor, g px.Guard)
- func (t *HashType) CanSerializeAsString() bool
- func (t *HashType) Default() px.Type
- func (t *HashType) EntryType() px.Type
- func (t *HashType) Equals(o interface{}, g px.Guard) bool
- func (t *HashType) Generic() px.Type
- func (t *HashType) Get(key string) (value px.Value, ok bool)
- func (t *HashType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *HashType) IsInstance(o px.Value, g px.Guard) bool
- func (t *HashType) KeyType() px.Type
- func (t *HashType) MetaType() px.ObjectType
- func (t *HashType) Name() string
- func (t *HashType) PType() px.Type
- func (t *HashType) Parameters() []px.Value
- func (t *HashType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *HashType) Resolve(c px.Context) px.Type
- func (t *HashType) SerializationString() string
- func (t *HashType) Size() *IntegerType
- func (t *HashType) String() string
- func (t *HashType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (t *HashType) ValueType() px.Type
- type InitType
- func (t *InitType) Accept(v px.Visitor, g px.Guard)
- func (t *InitType) CanSerializeAsString() bool
- func (t *InitType) Default() px.Type
- func (t *InitType) EachSignature(doer func(signature px.Signature))
- func (t *InitType) Equals(o interface{}, g px.Guard) bool
- func (t *InitType) Get(key string) (px.Value, bool)
- func (t *InitType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *InitType) IsInstance(o px.Value, g px.Guard) bool
- func (t *InitType) MetaType() px.ObjectType
- func (t *InitType) Name() string
- func (t *InitType) New(c px.Context, args []px.Value) px.Value
- func (t *InitType) PType() px.Type
- func (t *InitType) Parameters() []px.Value
- func (t *InitType) Resolve(c px.Context) px.Type
- func (t *InitType) SerializationString() string
- func (t *InitType) String() string
- func (t *InitType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (t *InitType) Type() px.Type
- type IntegerType
- func (t *IntegerType) Accept(v px.Visitor, g px.Guard)
- func (t *IntegerType) CanSerializeAsString() bool
- func (t *IntegerType) Default() px.Type
- func (t *IntegerType) Equals(o interface{}, g px.Guard) bool
- func (t *IntegerType) Generic() px.Type
- func (t *IntegerType) Get(key string) (px.Value, bool)
- func (t *IntegerType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *IntegerType) IsInstance(o px.Value, g px.Guard) bool
- func (t *IntegerType) IsInstance2(n int64) bool
- func (t *IntegerType) IsInstance3(n int) bool
- func (t *IntegerType) IsUnbounded() bool
- func (t *IntegerType) Max() int64
- func (t *IntegerType) MetaType() px.ObjectType
- func (t *IntegerType) Min() int64
- func (t *IntegerType) Name() string
- func (t *IntegerType) PType() px.Type
- func (t *IntegerType) Parameters() []px.Value
- func (t *IntegerType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *IntegerType) SerializationString() string
- func (t *IntegerType) SizeParameters() []px.Value
- func (t *IntegerType) String() string
- func (t *IntegerType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type IterableType
- func (t *IterableType) Accept(v px.Visitor, g px.Guard)
- func (t *IterableType) CanSerializeAsString() bool
- func (t *IterableType) Default() px.Type
- func (t *IterableType) ElementType() px.Type
- func (t *IterableType) Equals(o interface{}, g px.Guard) bool
- func (t *IterableType) Generic() px.Type
- func (t *IterableType) Get(key string) (value px.Value, ok bool)
- func (t *IterableType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *IterableType) IsInstance(o px.Value, g px.Guard) bool
- func (t *IterableType) MetaType() px.ObjectType
- func (t *IterableType) Name() string
- func (t *IterableType) PType() px.Type
- func (t *IterableType) Parameters() []px.Value
- func (t *IterableType) Resolve(c px.Context) px.Type
- func (t *IterableType) SerializationString() string
- func (t *IterableType) String() string
- func (t *IterableType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type IteratorType
- func (t *IteratorType) Accept(v px.Visitor, g px.Guard)
- func (t *IteratorType) CanSerializeAsString() bool
- func (t *IteratorType) Default() px.Type
- func (t *IteratorType) ElementType() px.Type
- func (t *IteratorType) Equals(o interface{}, g px.Guard) bool
- func (t *IteratorType) Generic() px.Type
- func (t *IteratorType) Get(key string) (value px.Value, ok bool)
- func (t *IteratorType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *IteratorType) IsInstance(o px.Value, g px.Guard) bool
- func (t *IteratorType) MetaType() px.ObjectType
- func (t *IteratorType) Name() string
- func (t *IteratorType) PType() px.Type
- func (t *IteratorType) Parameters() []px.Value
- func (t *IteratorType) Resolve(c px.Context) px.Type
- func (t *IteratorType) SerializationString() string
- func (t *IteratorType) String() string
- func (t *IteratorType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type LazyType
- type LikeType
- func (t *LikeType) Accept(v px.Visitor, g px.Guard)
- func (t *LikeType) Default() px.Type
- func (t *LikeType) Equals(o interface{}, g px.Guard) bool
- func (t *LikeType) Get(key string) (px.Value, bool)
- func (t *LikeType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *LikeType) IsInstance(o px.Value, g px.Guard) bool
- func (t *LikeType) MetaType() px.ObjectType
- func (t *LikeType) Name() string
- func (t *LikeType) PType() px.Type
- func (t *LikeType) Parameters() []px.Value
- func (t *LikeType) Resolve(c px.Context) px.Type
- func (t *LikeType) String() string
- func (t *LikeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Mapping
- type MutableHashValue
- type NotUndefType
- func (t *NotUndefType) Accept(v px.Visitor, g px.Guard)
- func (t *NotUndefType) CanSerializeAsString() bool
- func (t *NotUndefType) ContainedType() px.Type
- func (t *NotUndefType) Default() px.Type
- func (t *NotUndefType) Equals(o interface{}, g px.Guard) bool
- func (t *NotUndefType) Generic() px.Type
- func (t *NotUndefType) Get(key string) (value px.Value, ok bool)
- func (t *NotUndefType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *NotUndefType) IsInstance(o px.Value, g px.Guard) bool
- func (t *NotUndefType) MetaType() px.ObjectType
- func (t *NotUndefType) Name() string
- func (t *NotUndefType) PType() px.Type
- func (t *NotUndefType) Parameters() []px.Value
- func (t *NotUndefType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *NotUndefType) Resolve(c px.Context) px.Type
- func (t *NotUndefType) SerializationString() string
- func (t *NotUndefType) String() string
- func (t *NotUndefType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type NumericType
- func (t *NumericType) Accept(v px.Visitor, g px.Guard)
- func (t *NumericType) CanSerializeAsString() bool
- func (t *NumericType) Equals(o interface{}, g px.Guard) bool
- func (t *NumericType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *NumericType) IsInstance(o px.Value, g px.Guard) bool
- func (t *NumericType) MetaType() px.ObjectType
- func (t *NumericType) Name() string
- func (t *NumericType) PType() px.Type
- func (t *NumericType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *NumericType) SerializationString() string
- func (t *NumericType) String() string
- func (t *NumericType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type OptionalType
- func (t *OptionalType) Accept(v px.Visitor, g px.Guard)
- func (t *OptionalType) CanSerializeAsString() bool
- func (t *OptionalType) ContainedType() px.Type
- func (t *OptionalType) Default() px.Type
- func (t *OptionalType) Equals(o interface{}, g px.Guard) bool
- func (t *OptionalType) Generic() px.Type
- func (t *OptionalType) Get(key string) (value px.Value, ok bool)
- func (t *OptionalType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *OptionalType) IsInstance(o px.Value, g px.Guard) bool
- func (t *OptionalType) MetaType() px.ObjectType
- func (t *OptionalType) Name() string
- func (t *OptionalType) PType() px.Type
- func (t *OptionalType) Parameters() []px.Value
- func (t *OptionalType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *OptionalType) Resolve(c px.Context) px.Type
- func (t *OptionalType) SerializationString() string
- func (t *OptionalType) String() string
- func (t *OptionalType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type PatternType
- func (t *PatternType) Accept(v px.Visitor, g px.Guard)
- func (t *PatternType) CanSerializeAsString() bool
- func (t *PatternType) Default() px.Type
- func (t *PatternType) Equals(o interface{}, g px.Guard) bool
- func (t *PatternType) Get(key string) (value px.Value, ok bool)
- func (t *PatternType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *PatternType) IsInstance(o px.Value, g px.Guard) bool
- func (t *PatternType) MetaType() px.ObjectType
- func (t *PatternType) Name() string
- func (t *PatternType) PType() px.Type
- func (t *PatternType) Parameters() []px.Value
- func (t *PatternType) Patterns() *Array
- func (t *PatternType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *PatternType) SerializationString() string
- func (t *PatternType) String() string
- func (t *PatternType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Regexp
- func (r *Regexp) Equals(o interface{}, g px.Guard) bool
- func (r *Regexp) Match(s string) []string
- func (r *Regexp) PType() px.Type
- func (r *Regexp) PatternString() string
- func (r *Regexp) Reflect(c px.Context) reflect.Value
- func (r *Regexp) ReflectTo(c px.Context, dest reflect.Value)
- func (r *Regexp) Regexp() *regexp.Regexp
- func (r *Regexp) String() string
- func (r *Regexp) ToKey(b *bytes.Buffer)
- func (r *Regexp) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type RegexpType
- func (t *RegexpType) Accept(v px.Visitor, g px.Guard)
- func (t *RegexpType) CanSerializeAsString() bool
- func (t *RegexpType) Default() px.Type
- func (t *RegexpType) Equals(o interface{}, g px.Guard) bool
- func (t *RegexpType) Get(key string) (value px.Value, ok bool)
- func (t *RegexpType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *RegexpType) IsInstance(o px.Value, g px.Guard) bool
- func (t *RegexpType) MetaType() px.ObjectType
- func (t *RegexpType) Name() string
- func (t *RegexpType) PType() px.Type
- func (t *RegexpType) Parameters() []px.Value
- func (t *RegexpType) PatternString() string
- func (t *RegexpType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *RegexpType) Regexp() *regexp.Regexp
- func (t *RegexpType) SerializationString() string
- func (t *RegexpType) String() string
- func (t *RegexpType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type RuntimeType
- func (t *RuntimeType) Accept(v px.Visitor, g px.Guard)
- func (t *RuntimeType) CanSerializeAsString() bool
- func (t *RuntimeType) Default() px.Type
- func (t *RuntimeType) Equals(o interface{}, g px.Guard) bool
- func (t *RuntimeType) Generic() px.Type
- func (t *RuntimeType) Get(key string) (px.Value, bool)
- func (t *RuntimeType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *RuntimeType) IsInstance(o px.Value, g px.Guard) bool
- func (t *RuntimeType) MetaType() px.ObjectType
- func (t *RuntimeType) Name() string
- func (t *RuntimeType) PType() px.Type
- func (t *RuntimeType) Parameters() []px.Value
- func (t *RuntimeType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *RuntimeType) SerializationString() string
- func (t *RuntimeType) String() string
- func (t *RuntimeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type RuntimeValue
- func (rv *RuntimeValue) Equals(o interface{}, g px.Guard) bool
- func (rv *RuntimeValue) Interface() interface{}
- func (rv *RuntimeValue) PType() px.Type
- func (rv *RuntimeValue) Reflect(c px.Context) reflect.Value
- func (rv *RuntimeValue) ReflectTo(c px.Context, dest reflect.Value)
- func (rv *RuntimeValue) String() string
- func (rv *RuntimeValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type ScalarDataType
- func (t *ScalarDataType) Accept(v px.Visitor, g px.Guard)
- func (t *ScalarDataType) CanSerializeAsString() bool
- func (t *ScalarDataType) Equals(o interface{}, g px.Guard) bool
- func (t *ScalarDataType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *ScalarDataType) IsInstance(o px.Value, g px.Guard) bool
- func (t *ScalarDataType) MetaType() px.ObjectType
- func (t *ScalarDataType) Name() string
- func (t *ScalarDataType) PType() px.Type
- func (t *ScalarDataType) SerializationString() string
- func (t *ScalarDataType) String() string
- func (t *ScalarDataType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type ScalarType
- func (t *ScalarType) Accept(v px.Visitor, g px.Guard)
- func (t *ScalarType) CanSerializeAsString() bool
- func (t *ScalarType) Equals(o interface{}, g px.Guard) bool
- func (t *ScalarType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *ScalarType) IsInstance(o px.Value, g px.Guard) bool
- func (t *ScalarType) MetaType() px.ObjectType
- func (t *ScalarType) Name() string
- func (t *ScalarType) PType() px.Type
- func (t *ScalarType) SerializationString() string
- func (t *ScalarType) String() string
- func (t *ScalarType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type SemVer
- func (v *SemVer) CanSerializeAsString() bool
- func (v *SemVer) Equals(o interface{}, g px.Guard) bool
- func (v *SemVer) PType() px.Type
- func (v *SemVer) Reflect(c px.Context) reflect.Value
- func (v *SemVer) ReflectTo(c px.Context, dest reflect.Value)
- func (v *SemVer) SerializationString() string
- func (v *SemVer) String() string
- func (v *SemVer) ToKey(b *bytes.Buffer)
- func (v *SemVer) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (v *SemVer) Version() semver.Version
- type SemVerRange
- func (bv *SemVerRange) CanSerializeAsString() bool
- func (bv *SemVerRange) Equals(o interface{}, g px.Guard) bool
- func (bv *SemVerRange) PType() px.Type
- func (bv *SemVerRange) Reflect(c px.Context) reflect.Value
- func (bv *SemVerRange) ReflectTo(c px.Context, dest reflect.Value)
- func (bv *SemVerRange) SerializationString() string
- func (bv *SemVerRange) String() string
- func (bv *SemVerRange) ToKey(b *bytes.Buffer)
- func (bv *SemVerRange) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (bv *SemVerRange) VersionRange() semver.VersionRange
- type SemVerRangeType
- func (t *SemVerRangeType) Accept(v px.Visitor, g px.Guard)
- func (t *SemVerRangeType) CanSerializeAsString() bool
- func (t *SemVerRangeType) Equals(o interface{}, g px.Guard) bool
- func (t *SemVerRangeType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *SemVerRangeType) IsInstance(o px.Value, g px.Guard) bool
- func (t *SemVerRangeType) MetaType() px.ObjectType
- func (t *SemVerRangeType) Name() string
- func (t *SemVerRangeType) PType() px.Type
- func (t *SemVerRangeType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *SemVerRangeType) SerializationString() string
- func (t *SemVerRangeType) String() string
- func (t *SemVerRangeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type SemVerType
- func (t *SemVerType) Accept(v px.Visitor, g px.Guard)
- func (t *SemVerType) CanSerializeAsString() bool
- func (t *SemVerType) Default() px.Type
- func (t *SemVerType) Equals(o interface{}, g px.Guard) bool
- func (t *SemVerType) Get(key string) (px.Value, bool)
- func (t *SemVerType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *SemVerType) IsInstance(o px.Value, g px.Guard) bool
- func (t *SemVerType) MetaType() px.ObjectType
- func (t *SemVerType) Name() string
- func (t *SemVerType) PType() px.Type
- func (t *SemVerType) Parameters() []px.Value
- func (t *SemVerType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *SemVerType) SerializationString() string
- func (t *SemVerType) String() string
- func (t *SemVerType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Sensitive
- func (s *Sensitive) Equals(o interface{}, g px.Guard) bool
- func (s *Sensitive) PType() px.Type
- func (s *Sensitive) Reflect(c px.Context) reflect.Value
- func (s *Sensitive) ReflectTo(c px.Context, value reflect.Value)
- func (s *Sensitive) String() string
- func (s *Sensitive) ToString(b io.Writer, f px.FormatContext, g px.RDetect)
- func (s *Sensitive) Unwrap() px.Value
- type SensitiveType
- func (t *SensitiveType) Accept(v px.Visitor, g px.Guard)
- func (t *SensitiveType) CanSerializeAsString() bool
- func (t *SensitiveType) ContainedType() px.Type
- func (t *SensitiveType) Default() px.Type
- func (t *SensitiveType) Equals(o interface{}, g px.Guard) bool
- func (t *SensitiveType) Generic() px.Type
- func (t *SensitiveType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *SensitiveType) IsInstance(o px.Value, g px.Guard) bool
- func (t *SensitiveType) MetaType() px.ObjectType
- func (t *SensitiveType) Name() string
- func (t *SensitiveType) PType() px.Type
- func (t *SensitiveType) Parameters() []px.Value
- func (t *SensitiveType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *SensitiveType) Resolve(c px.Context) px.Type
- func (t *SensitiveType) SerializationString() string
- func (t *SensitiveType) String() string
- func (t *SensitiveType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type StructElement
- func (s *StructElement) Accept(v px.Visitor, g px.Guard)
- func (s *StructElement) ActualKeyType() px.Type
- func (s *StructElement) Equals(o interface{}, g px.Guard) bool
- func (s *StructElement) Key() px.Type
- func (s *StructElement) Name() string
- func (s *StructElement) Optional() bool
- func (s *StructElement) PType() px.Type
- func (s *StructElement) String() string
- func (s *StructElement) ToString(bld io.Writer, format px.FormatContext, g px.RDetect)
- func (s *StructElement) Value() px.Type
- type StructType
- func (t *StructType) Accept(v px.Visitor, g px.Guard)
- func (t *StructType) CanSerializeAsString() bool
- func (t *StructType) Default() px.Type
- func (t *StructType) Elements() []*StructElement
- func (t *StructType) Equals(o interface{}, g px.Guard) bool
- func (t *StructType) Generic() px.Type
- func (t *StructType) Get(key string) (value px.Value, ok bool)
- func (t *StructType) HashedMembers() map[string]*StructElement
- func (t *StructType) HashedMembersCloned() map[string]*StructElement
- func (t *StructType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *StructType) IsInstance(o px.Value, g px.Guard) bool
- func (t *StructType) MetaType() px.ObjectType
- func (t *StructType) Name() string
- func (t *StructType) PType() px.Type
- func (t *StructType) Parameters() []px.Value
- func (t *StructType) Resolve(c px.Context) px.Type
- func (t *StructType) SerializationString() string
- func (t *StructType) Size() *IntegerType
- func (t *StructType) String() string
- func (t *StructType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Timespan
- func (tv Timespan) Abs() px.Number
- func (tv Timespan) CanSerializeAsString() bool
- func (tv Timespan) Days() int64
- func (tv Timespan) Duration() time.Duration
- func (tv Timespan) Equals(o interface{}, g px.Guard) bool
- func (tv Timespan) Float() float64
- func (tv Timespan) Format(format string) string
- func (tv Timespan) Hours() int64
- func (tv Timespan) Int() int64
- func (tv Timespan) Milliseconds() int64
- func (tv Timespan) Minutes() int64
- func (tv Timespan) PType() px.Type
- func (tv Timespan) Reflect(c px.Context) reflect.Value
- func (tv Timespan) ReflectTo(c px.Context, dest reflect.Value)
- func (tv Timespan) Seconds() int64
- func (tv Timespan) SerializationString() string
- func (tv Timespan) String() string
- func (tv Timespan) ToKey(b *bytes.Buffer)
- func (tv Timespan) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type TimespanFormat
- type TimespanFormatParser
- type TimespanType
- func (t *TimespanType) Accept(v px.Visitor, g px.Guard)
- func (t *TimespanType) CanSerializeAsString() bool
- func (t *TimespanType) Default() px.Type
- func (t *TimespanType) Equals(other interface{}, guard px.Guard) bool
- func (t *TimespanType) Get(key string) (px.Value, bool)
- func (t *TimespanType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TimespanType) IsInstance(o px.Value, g px.Guard) bool
- func (t *TimespanType) MetaType() px.ObjectType
- func (t *TimespanType) Name() string
- func (t *TimespanType) PType() px.Type
- func (t *TimespanType) Parameters() []px.Value
- func (t *TimespanType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *TimespanType) SerializationString() string
- func (t *TimespanType) String() string
- func (t *TimespanType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type Timestamp
- func (tv *Timestamp) CanSerializeAsString() bool
- func (tv *Timestamp) Equals(o interface{}, g px.Guard) bool
- func (tv *Timestamp) Float() float64
- func (tv *Timestamp) Format(format string) string
- func (tv *Timestamp) Format2(format, tz string) string
- func (tv *Timestamp) Int() int64
- func (tv *Timestamp) PType() px.Type
- func (tv *Timestamp) Reflect(c px.Context) reflect.Value
- func (tv *Timestamp) ReflectTo(c px.Context, dest reflect.Value)
- func (tv *Timestamp) SerializationString() string
- func (tv *Timestamp) String() string
- func (tv *Timestamp) Time() time.Time
- func (tv *Timestamp) ToKey(b *bytes.Buffer)
- func (tv *Timestamp) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type TimestampFormat
- type TimestampFormatParser
- type TimestampType
- func (t *TimestampType) Accept(v px.Visitor, g px.Guard)
- func (t *TimestampType) CanSerializeAsString() bool
- func (t *TimestampType) Default() px.Type
- func (t *TimestampType) Equals(other interface{}, guard px.Guard) bool
- func (t *TimestampType) Get(key string) (px.Value, bool)
- func (t *TimestampType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TimestampType) IsInstance(o px.Value, g px.Guard) bool
- func (t *TimestampType) MetaType() px.ObjectType
- func (t *TimestampType) Name() string
- func (t *TimestampType) PType() px.Type
- func (t *TimestampType) Parameters() []px.Value
- func (t *TimestampType) ReflectType(c px.Context) (reflect.Type, bool)
- func (t *TimestampType) SerializationString() string
- func (t *TimestampType) String() string
- func (t *TimestampType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type TupleType
- func (t *TupleType) Accept(v px.Visitor, g px.Guard)
- func (t *TupleType) At(i int) px.Value
- func (t *TupleType) CanSerializeAsString() bool
- func (t *TupleType) CommonElementType() px.Type
- func (t *TupleType) Default() px.Type
- func (t *TupleType) Equals(o interface{}, g px.Guard) bool
- func (t *TupleType) Generic() px.Type
- func (t *TupleType) Get(key string) (value px.Value, ok bool)
- func (t *TupleType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TupleType) IsInstance(v px.Value, g px.Guard) bool
- func (t *TupleType) IsInstance2(vs px.List, g px.Guard) bool
- func (t *TupleType) IsInstance3(vs []px.Value, g px.Guard) bool
- func (t *TupleType) MetaType() px.ObjectType
- func (t *TupleType) Name() string
- func (t *TupleType) PType() px.Type
- func (t *TupleType) Parameters() []px.Value
- func (t *TupleType) Resolve(c px.Context) px.Type
- func (t *TupleType) SerializationString() string
- func (t *TupleType) Size() *IntegerType
- func (t *TupleType) String() string
- func (t *TupleType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (t *TupleType) Types() []px.Type
- type TypeAliasType
- func (t *TypeAliasType) Accept(v px.Visitor, g px.Guard)
- func (t *TypeAliasType) Default() px.Type
- func (t *TypeAliasType) Equals(o interface{}, g px.Guard) bool
- func (t *TypeAliasType) Get(key string) (px.Value, bool)
- func (t *TypeAliasType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TypeAliasType) IsInstance(o px.Value, g px.Guard) bool
- func (t *TypeAliasType) Loader() px.Loader
- func (t *TypeAliasType) MetaType() px.ObjectType
- func (t *TypeAliasType) Name() string
- func (t *TypeAliasType) PType() px.Type
- func (t *TypeAliasType) Resolve(c px.Context) px.Type
- func (t *TypeAliasType) ResolvedType() px.Type
- func (t *TypeAliasType) String() string
- func (t *TypeAliasType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type TypeReferenceType
- func (t *TypeReferenceType) Accept(v px.Visitor, g px.Guard)
- func (t *TypeReferenceType) CanSerializeAsString() bool
- func (t *TypeReferenceType) Default() px.Type
- func (t *TypeReferenceType) Equals(o interface{}, g px.Guard) bool
- func (t *TypeReferenceType) Get(key string) (px.Value, bool)
- func (t *TypeReferenceType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TypeReferenceType) IsInstance(o px.Value, g px.Guard) bool
- func (t *TypeReferenceType) MetaType() px.ObjectType
- func (t *TypeReferenceType) Name() string
- func (t *TypeReferenceType) PType() px.Type
- func (t *TypeReferenceType) Parameters() []px.Value
- func (t *TypeReferenceType) Resolve(c px.Context) px.Type
- func (t *TypeReferenceType) SerializationString() string
- func (t *TypeReferenceType) String() string
- func (t *TypeReferenceType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (t *TypeReferenceType) TypeString() string
- type TypeType
- func (t *TypeType) Accept(v px.Visitor, g px.Guard)
- func (t *TypeType) CanSerializeAsString() bool
- func (t *TypeType) ContainedType() px.Type
- func (t *TypeType) Default() px.Type
- func (t *TypeType) Equals(o interface{}, g px.Guard) bool
- func (t *TypeType) Generic() px.Type
- func (t *TypeType) Get(key string) (value px.Value, ok bool)
- func (t *TypeType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *TypeType) IsInstance(o px.Value, g px.Guard) bool
- func (t *TypeType) MetaType() px.ObjectType
- func (t *TypeType) Name() string
- func (t *TypeType) PType() px.Type
- func (t *TypeType) Parameters() []px.Value
- func (t *TypeType) Resolve(c px.Context) px.Type
- func (t *TypeType) SerializationString() string
- func (t *TypeType) String() string
- func (t *TypeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type UndefType
- func (t *UndefType) Accept(v px.Visitor, g px.Guard)
- func (t *UndefType) CanSerializeAsString() bool
- func (t *UndefType) Equals(o interface{}, g px.Guard) bool
- func (t *UndefType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *UndefType) IsInstance(o px.Value, g px.Guard) bool
- func (t *UndefType) MetaType() px.ObjectType
- func (t *UndefType) Name() string
- func (t *UndefType) PType() px.Type
- func (t *UndefType) SerializationString() string
- func (t *UndefType) String() string
- func (t *UndefType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type UndefValue
- func (uv *UndefValue) Equals(o interface{}, g px.Guard) bool
- func (uv *UndefValue) MarshalJSON() ([]byte, error)
- func (uv *UndefValue) MarshalYAML() (interface{}, error)
- func (uv *UndefValue) PType() px.Type
- func (uv *UndefValue) Reflect(c px.Context) reflect.Value
- func (uv *UndefValue) ReflectTo(c px.Context, value reflect.Value)
- func (uv *UndefValue) String() string
- func (uv *UndefValue) ToKey() px.HashKey
- func (uv *UndefValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type UnitType
- func (t *UnitType) Accept(v px.Visitor, g px.Guard)
- func (t *UnitType) CanSerializeAsString() bool
- func (t *UnitType) Equals(o interface{}, g px.Guard) bool
- func (t *UnitType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *UnitType) IsInstance(o px.Value, g px.Guard) bool
- func (t *UnitType) MetaType() px.ObjectType
- func (t *UnitType) Name() string
- func (t *UnitType) PType() px.Type
- func (t *UnitType) SerializationString() string
- func (t *UnitType) String() string
- func (t *UnitType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type UriType
- func (t *UriType) Accept(v px.Visitor, g px.Guard)
- func (t *UriType) CanSerializeAsString() bool
- func (t *UriType) Default() px.Type
- func (t *UriType) Equals(other interface{}, g px.Guard) bool
- func (t *UriType) Get(key string) (value px.Value, ok bool)
- func (t *UriType) IsAssignable(other px.Type, g px.Guard) bool
- func (t *UriType) IsInstance(other px.Value, g px.Guard) bool
- func (t *UriType) Member(name string) (px.CallableMember, bool)
- func (t *UriType) MetaType() px.ObjectType
- func (t *UriType) Name() string
- func (t *UriType) PType() px.Type
- func (t *UriType) Parameters() []px.Value
- func (t *UriType) SerializationString() string
- func (t *UriType) String() string
- func (t *UriType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- type UriValue
- func (u *UriValue) CanSerializeAsString() bool
- func (u *UriValue) Equals(other interface{}, guard px.Guard) bool
- func (u *UriValue) Get(key string) (px.Value, bool)
- func (u *UriValue) PType() px.Type
- func (u *UriValue) SerializationString() string
- func (u *UriValue) String() string
- func (u *UriValue) ToKey(b *bytes.Buffer)
- func (u *UriValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (u *UriValue) URL() *url.URL
- type VariantType
- func (t *VariantType) Accept(v px.Visitor, g px.Guard)
- func (t *VariantType) CanSerializeAsString() bool
- func (t *VariantType) Default() px.Type
- func (t *VariantType) Equals(o interface{}, g px.Guard) bool
- func (t *VariantType) Generic() px.Type
- func (t *VariantType) IsAssignable(o px.Type, g px.Guard) bool
- func (t *VariantType) IsInstance(o px.Value, g px.Guard) bool
- func (t *VariantType) MetaType() px.ObjectType
- func (t *VariantType) Name() string
- func (t *VariantType) PType() px.Type
- func (t *VariantType) Parameters() []px.Value
- func (t *VariantType) Resolve(c px.Context) px.Type
- func (t *VariantType) SerializationString() string
- func (t *VariantType) String() string
- func (t *VariantType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
- func (t *VariantType) Types() []px.Type
Examples ¶
Constants ¶
const ( NsecsPerUsec = 1000 NsecsPerMsec = NsecsPerUsec * 1000 NsecsPerSec = NsecsPerMsec * 1000 NsecsPerMin = NsecsPerSec * 60 NsecsPerHour = NsecsPerMin * 60 NsecsPerDay = NsecsPerHour * 24 KeyString = `string` KeyFormat = `format` KeyNegative = `negative` KeyDays = `days` KeyHours = `hours` KeyMinutes = `minutes` KeySeconds = `seconds` KeyMilliseconds = `milliseconds` KeyMicroseconds = `microseconds` KeyNanoseconds = `nanoseconds` )
const ( NoString = "\x00" HkArray = byte('A') HkBinary = byte('B') HkBoolean = byte('b') HkDefault = byte('d') HkEntry = byte('E') HkFloat = byte('f') HkHash = byte('H') HkInteger = byte('i') HkRegexp = byte('r') HkTimespan = byte('D') HkTimestamp = byte('T') HkType = byte('t') HkUndef = byte('u') HkUri = byte('U') HkVersion = byte('v') HkVersionRange = byte('R') IntegerHex = `(?:0[xX][0-9A-Fa-f]+)` IntegerOct = `(?:0[0-7]+)` IntegerBin = `(?:0[bB][01]+)` IntegerDec = `(?:0|[1-9]\d*)` SignPrefix = `[+-]?\s*` OptionalFraction = `(?:\.\d+)?` OptionalExponent = `(?:[eE]-?\d+)?` FloatDec = `(?:` + IntegerDec + OptionalFraction + OptionalExponent + `)` IntegerPattern = `\A` + SignPrefix + `(?:` + IntegerDec + `|` + IntegerHex + `|` + IntegerOct + `|` + IntegerBin + `)\z` FloatPattern = `\A` + SignPrefix + `(?:` + FloatDec + `|` + IntegerHex + `|` + IntegerOct + `|` + IntegerBin + `)\z` )
const ( KeyNameAuthority = `name_authority` KeyReferences = `references` KeyTypes = `types` KeyVersion = `version` KeyVersionRange = `version_range` )
const KeyGoName = `go_name`
const MaxUnixSecs = math.MaxInt64 - 62135596800
MAX_UNIX_SECS is an offset of 62135596800 seconds to sec that represents the number of seconds from 1970-01-01:00:00:00 UTC. This offset must be retracted from the MaxInt64 value in order for it to end up as that value internally.
const ParseError = `PARSE_ERROR`
Variables ¶
var AnyMetaType px.ObjectType
var ArrayMetaType px.ObjectType
var BinaryMetaType px.ObjectType
var BooleanFalse = booleanValue(false)
var BooleanMetaType px.ObjectType
var BooleanTrue = booleanValue(true)
var CallableMetaType px.ObjectType
var CollectionMetaType px.ObjectType
var DefaultAnyFormat = simpleFormat('s')
var DefaultArrayContainerFormat = basicFormat('p', `,`, '[', nil)
var DefaultArrayFormat = basicFormat('a', `,`, '[', nil)
var DefaultContainerFormats = px.FormatMap(WrapHash([]*HashEntry{ WrapHashEntry(DefaultObjectType(), DefaultObjectContainerFormat), WrapHashEntry(DefaultTypeType(), DefaultObjectContainerFormat), WrapHashEntry(DefaultFloatType(), DefaultProgramFormat), WrapHashEntry(DefaultNumericType(), DefaultProgramFormat), WrapHashEntry(DefaultArrayType(), DefaultArrayContainerFormat), WrapHashEntry(DefaultHashType(), DefaultHashContainerFormat), WrapHashEntry(DefaultBinaryType(), DefaultProgramFormat), WrapHashEntry(DefaultAnyType(), DefaultProgramFormat), }))
var DefaultFormats = px.FormatMap(WrapHash([]*HashEntry{ WrapHashEntry(DefaultObjectType(), DefaultObjectFormat), WrapHashEntry(DefaultTypeType(), DefaultObjectFormat), WrapHashEntry(DefaultFloatType(), simpleFormat('f')), WrapHashEntry(DefaultNumericType(), simpleFormat('d')), WrapHashEntry(DefaultArrayType(), DefaultArrayFormat), WrapHashEntry(DefaultHashType(), DefaultHashFormat), WrapHashEntry(DefaultBinaryType(), simpleFormat('B')), WrapHashEntry(DefaultAnyType(), DefaultAnyFormat), }))
var DefaultHashContainerFormat = basicFormat('p', ` => `, '{', nil)
var DefaultHashFormat = basicFormat('h', ` => `, '{', nil)
var DefaultIndentation = newIndentation(false, 0)
var DefaultMetaType px.ObjectType
var DefaultObjectContainerFormat = basicFormat('p', ` => `, '(', nil)
var DefaultObjectFormat = basicFormat('p', ` => `, '(', nil)
var DefaultProgramFormat = simpleFormat('p')
var DefaultTimespanFormats []*TimespanFormat
var DefaultTimestampFormats []*TimestampFormat
var DefaultTimestampFormatsWoTz []*TimestampFormat
var DeferredMetaType px.ObjectType
var EnumMetaType px.ObjectType
var Expanded = newFormatContext2(DefaultIndentation, DefaultFormats, map[string]string{`expanded`: `true`})
var FloatMetaType px.ObjectType
var HashMetaType px.ObjectType
var InitMetaType px.ObjectType
var IntegerMetaType px.ObjectType
var IntegerTypeOne = &IntegerType{1, 1}
var IntegerTypePositive = &IntegerType{0, math.MaxInt64}
var IntegerTypeZero = &IntegerType{0, 0}
var IterableMetaType px.ObjectType
var IteratorMetaType px.ObjectType
var LikeMetaType px.ObjectType
var MaxTime = time.Unix(MaxUnixSecs, 999999999)
var MemberNamePattern = regexp.MustCompile(`\A[a-z_]\w*\z`)
var MinTime = time.Time{}
var NoPositionalConstructor = func(c px.Context, args []px.Value) px.Value { panic(errors.New(`internal error: call to NoPositionalConstructor`)) }
var None = newFormatContext2(DefaultIndentation, DefaultFormats, nil)
var NotUndefMetaType px.ObjectType
var NumericMetaType px.ObjectType
var ObjectMetaType px.ObjectType
TODO: Implement Type.CanCoerce(Value)
Object.IsInstance is true if value is a Hash matching the attribute requirements where each entry value can be coerced into the attribute´s type
var ObjectTypeExtensionMetaType px.ObjectType
var OneCharStringType = NewStringType(NewIntegerType(1, 1), ``)
var OptionalMetaType px.ObjectType
var PatternMetaType px.ObjectType
var PrettyArrayFormat = basicAltFormat('a', `,`, '[', PrettyContainerFormats)
var PrettyContainerFormats = px.FormatMap(WrapHash([]*HashEntry{WrapHashEntry(DefaultAnyType(), PrettyProgramFormat)}))
var PrettyHashFormat = basicAltFormat('h', ` => `, '{', PrettyContainerFormats)
var PrettyIndentation = newIndentation(true, 0)
var PrettyObjectFormat = basicAltFormat('p', ` => `, '(', PrettyContainerFormats)
var PrettyProgramFormat = newFormat(`%#p`)
var Program = newFormatContext2(DefaultIndentation, px.FormatMap(singleMap(DefaultAnyType(), DefaultObjectFormat)), nil)
var RegexpMetaType px.ObjectType
var RuntimeMetaType px.ObjectType
var ScalarDataMetaType px.ObjectType
var ScalarMetaType px.ObjectType
var SemVerMetaType px.ObjectType
var SemVerRangeMetaType px.ObjectType
var SensitiveMetaType px.ObjectType
var StringMetaType px.ObjectType
var StructElementMeta px.Type
var StructMetaType px.ObjectType
var TagsAnnotationType px.ObjectType
var TimespanMax = time.Duration(math.MaxInt64)
var TimespanMetaType px.ObjectType
var TimespanMin = time.Duration(math.MinInt64)
var TimestampMetaType px.ObjectType
var TupleMetaType px.ObjectType
var TypeAliasMetaType px.ObjectType
var TypeAttributes = NewHashType(TypeMemberName, DefaultNotUndefType(), nil)
var TypeConstants = NewHashType(TypeMemberName, DefaultAnyType(), nil)
var TypeEquality = newVariantType2(TypeMemberName, TypeMemberNames)
var TypeFunctions = NewHashType(newVariantType2(TypeMemberName, newPatternType2(NewRegexpTypeR(regexp.MustCompile(`^\[]$`)))), DefaultNotUndefType(), nil)
var TypeMemberName = newPatternType2(NewRegexpTypeR(MemberNamePattern))
var TypeMemberNames = newArrayType2(TypeMemberName)
var TypeMetaType px.ObjectType
var TypeNamePattern = regexp.MustCompile(`\A[A-Z][\w]*(?:::[A-Z][\w]*)*\z`)
var TypeObjectInitHash = NewStructType([]*StructElement{ NewStructElement(newOptionalType3(keyName), TypeTypeName), NewStructElement(newOptionalType3(keyParent), NewVariantType(DefaultTypeType(), TypeTypeName)), NewStructElement(newOptionalType3(keyTypeParameters), TypeParameters), NewStructElement(newOptionalType3(keyAttributes), TypeAttributes), NewStructElement(newOptionalType3(keyConstants), TypeConstants), NewStructElement(newOptionalType3(keyFunctions), TypeFunctions), NewStructElement(newOptionalType3(keyEquality), TypeEquality), NewStructElement(newOptionalType3(keyEqualityIncludeType), DefaultBooleanType()), NewStructElement(newOptionalType3(keyEquality), TypeEquality), NewStructElement(newOptionalType3(keySerialization), TypeMemberNames), NewStructElement(newOptionalType3(keyAnnotations), typeAnnotations), })
var TypeParameters = NewHashType(TypeMemberName, DefaultNotUndefType(), nil)
var TypeQualifiedReference = NewPatternType([]*RegexpType{NewRegexpType(`\A[A-Z][\w]*(?:::[A-Z][\w]*)*\z`)})
var TypeReferenceMetaType px.ObjectType
var TypeSetMetaType px.ObjectType
var TypeSimpleTypeName = NewPatternType([]*RegexpType{NewRegexpType(`\A[A-Z]\w*\z`)})
var TypeTypeName = NewPatternType([]*RegexpType{NewRegexpTypeR(TypeNamePattern)})
var TypeTypeParameter = NewStructType([]*StructElement{ newStructElement2(keyType, DefaultTypeType()), NewStructElement(newOptionalType3(keyAnnotations), typeAnnotations), })
var TypedNameMetaType px.ObjectType
var URIMetaType px.ObjectType
var UndefMetaType px.ObjectType
var UnitMetaType px.ObjectType
var VariantMetaType px.ObjectType
var ZERO = integerValue(0)
Functions ¶
func AllocObjectType ¶
func AllocObjectType() *objectType
func AllocObjectValue ¶
func AllocObjectValue(typ px.ObjectType) px.Object
func AllocTypeSetType ¶
func AllocTypeSetType() *typeSet
func BuildObjectType ¶
func BuildObjectType(name string, parent px.Type, hashProducer func(px.ObjectType) px.OrderedMap) px.ObjectType
func CanCoerce ¶
CanCoerce responds true iv the given value can be coerced into an instance of the given type.
func CoerceTo ¶
CoerceTo will deep coerce the given value into an instance of the given type t. The coercion will recurse down into hashes, arrays, and objects and take key, value, and attribute types into account.
The label is used in potential type assertion errors. It should indicate what it is that is being coerced.
func DefaultAnnotationType ¶
func DefaultObjectType ¶
func DefaultObjectType() *objectType
func DefaultStringType ¶
func DefaultStringType() *stringType
func DefaultTypeSetType ¶
func EachCoreType ¶
func FieldName ¶
func FieldName(f *reflect.StructField) string
func FormatFromHash ¶
func MakeObjectType ¶
func MakeObjectType(name string, parent px.Type, initHash px.OrderedMap, register bool, creators ...px.DispatchFunction) *objectType
MakeObjectType creates a new object type and optionally registers it as a resolvable to be picked up for resolution on the next call to px.ResolveResolvables if the given register flag is true. This flag should only be set to true when the call stems from a static init() function where no context is available.
func MapToRegexps ¶
func MapToRegexps(regexpTypes []*RegexpType) []*regexp.Regexp
func NewDeferred ¶
func NewFormatMap ¶
func NewObjectTypeExtension ¶
func NewObjectValue ¶
func NewReflectedValue ¶
func NewStringType ¶
func NewStringType(rng *IntegerType, s string) px.Type
func NewTagsAnnotation ¶
func NewTagsAnnotation(tags px.OrderedMap) px.TagsAnnotation
func NewTypeSet ¶
func NormalizeType ¶
NormalizeType ensures that pointers to interface is converted to interface and that struct is converted to pointer to struct
func ObjectToString ¶
func ObjectToString(o px.PuppetObject, s px.FormatContext, b io.Writer, g px.RDetect)
func Parse ¶
Parse calls ParseFile with the string "<pcore type expression>" as the fileName
Example (Entry) ¶
package main import ( "fmt" "os" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { const src = `# This is scanned code. constants => { first => 0, second => 0x32, third => 2e4, fourth => 2.3e-2, fifth => 'hello', sixth => "world", type => Foo::Bar[1,'23',Baz[1,2]], value => "String\nWith \\Escape", array => [a, b, c], call => Boo::Bar("with", "args") } ` v := types.Parse(src) v.ToString(os.Stdout, px.PrettyExpanded, nil) fmt.Println() }
Output: { 'constants' => { 'first' => 0, 'second' => 50, 'third' => 20000.0, 'fourth' => 0.02300, 'fifth' => 'hello', 'sixth' => 'world', 'type' => DeferredType(Foo::Bar, [1, '23', DeferredType(Baz, [1, 2])]), 'value' => "String\nWith \\Escape", 'array' => ['a', 'b', 'c'], 'call' => Deferred( 'name' => 'new', 'arguments' => ['Boo::Bar', 'with', 'args'] ) } }
Example (Hash) ¶
package main import ( "fmt" "github.com/lyraproj/pcore/types" ) func main() { v := types.Parse(`{value=>-1}`) fmt.Println(v) }
Output: {'value' => -1}
Example (Int) ¶
package main import ( "fmt" "os" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { t := types.Parse(`23`) t.ToString(os.Stdout, px.PrettyExpanded, nil) fmt.Println() }
Output: 23
Example (QName) ¶
package main import ( "fmt" "os" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { t := types.Parse(`Foo::Bar`) t.ToString(os.Stdout, px.PrettyExpanded, nil) fmt.Println() }
Output: DeferredType(Foo::Bar)
func ParseFile ¶
ParseFile parses the given content into a px.Value. The content must be a string representation of a Puppet literal or a type assignment expression. Valid literals are float, integer, string, boolean, undef, array, hash, parameter lists, and type expressions.
Double quoted strings containing interpolation expressions will be parsed into a string verbatim without resolving the interpolations.
func ParseTagHash ¶
func ParseTagHash(tag string) (px.OrderedMap, bool)
func ParseTags ¶
Example ¶
fmt.Println(WrapStringToStringMap(ParseTags(`puppet:"hey\"ho" lyra:"here we go"`)))
Output: {'lyra' => 'here we go', 'puppet' => 'hey"ho'}
func ParseURI ¶
ParseURI parses a string into a uri.URL and panics with an issue code if the parse fails
func PopDeclaredTypes ¶
func PopDeclaredTypes() (types []px.ResolvableType)
func PuppetFprintf ¶
PuppetFprintf is like fmt.Fprintf but using named arguments accessed with %{key} formatting instructions and using Puppet StringFormatter for evaluating formatting specifications
func PuppetSprintf ¶
PuppetSprintf is like fmt.Fprintf but using named arguments accessed with %{key} formatting instructions and using Puppet StringFormatter for evaluating formatting specifications
func ResolveDeferred ¶
ResolveDeferred will resolve all occurrences of a DeferredValue in its given argument. Array and Hash arguments will be resolved recursively.
func TagHash ¶
func TagHash(f *reflect.StructField) (px.OrderedMap, bool)
func TimeFromString ¶
func TypeToString ¶
func URIFromHash ¶
func UniqueValues ¶
Example ¶
package main import ( "fmt" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { x := types.WrapString(`hello`) y := types.WrapInteger(32) types.UniqueValues([]px.Value{x, y}) z := types.WrapString(`hello`) sv := []px.StringValue{x, z} fmt.Println(types.UniqueValues([]px.Value{sv[0], sv[1]})) }
Output: [hello]
func ValueSlice ¶
ValueSlice convert a slice of values that implement the pcore.Value interface to []pcore.Value. The method will panic if the given argument is not a slice or array, or if not all elements implement the pcore.Value interface
func WrapBoolean ¶
func WrapInteger ¶
func WrapString ¶
func WrapString(str string) px.StringValue
Types ¶
type AnyType ¶
type AnyType struct{}
func DefaultAnyType ¶
func DefaultAnyType() *AnyType
func (*AnyType) CanSerializeAsString ¶
func (*AnyType) MetaType ¶
func (t *AnyType) MetaType() px.ObjectType
func (*AnyType) SerializationString ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func SingletonArray ¶
func WrapArray3 ¶
func WrapInterfaces ¶
func WrapStrings ¶
func WrapValues ¶
func (*Array) DetailedType ¶
func (*Array) EachWithIndex ¶
func (av *Array) EachWithIndex(consumer px.IndexedConsumer)
func (*Array) ElementType ¶
func (*Array) IsHashStyle ¶
type ArrayType ¶
type ArrayType struct {
// contains filtered or unexported fields
}
func DefaultArrayType ¶
func DefaultArrayType() *ArrayType
func EmptyArrayType ¶
func EmptyArrayType() *ArrayType
func NewArrayType ¶
func NewArrayType(element px.Type, rng *IntegerType) *ArrayType
func (*ArrayType) CanSerializeAsString ¶
func (*ArrayType) ElementType ¶
func (*ArrayType) MetaType ¶
func (t *ArrayType) MetaType() px.ObjectType
func (*ArrayType) Parameters ¶
func (*ArrayType) SerializationString ¶
func (*ArrayType) Size ¶
func (t *ArrayType) Size() *IntegerType
type BasicCollector ¶
type BasicCollector struct {
// contains filtered or unexported fields
}
A BasicCollector is an extendable basic implementation of the Collector interface
func (*BasicCollector) Add ¶
func (hm *BasicCollector) Add(element px.Value)
func (*BasicCollector) AddRef ¶
func (hm *BasicCollector) AddRef(ref int)
func (*BasicCollector) CanDoBinary ¶
func (hm *BasicCollector) CanDoBinary() bool
func (*BasicCollector) CanDoComplexKeys ¶
func (hm *BasicCollector) CanDoComplexKeys() bool
func (*BasicCollector) Init ¶
func (hm *BasicCollector) Init()
func (*BasicCollector) PopLast ¶
func (hm *BasicCollector) PopLast() px.Value
func (*BasicCollector) StringDedupThreshold ¶
func (hm *BasicCollector) StringDedupThreshold() int
func (*BasicCollector) Value ¶
func (hm *BasicCollector) Value() px.Value
type Binary ¶
type Binary struct {
// contains filtered or unexported fields
}
Binary keeps only the value because the type is known and not parameterized
func BinaryFromArray ¶
func BinaryFromFile ¶
BinaryFromFile opens file appointed by the given path for reading and returns its contents as a Binary. The function will panic with an issue.Reported unless the operation succeeds.
func BinaryFromFile2 ¶
BinaryFromFile2 opens file appointed by the given path for reading and returns its contents as a Binary together with a boolean indicating if the file was found or not.
The function will only return false if the given file does not exist. It will panic with an issue.Reported on all other errors.
func BinaryFromString ¶
func WrapBinary ¶
func (*Binary) CanSerializeAsString ¶
func (*Binary) SerializationString ¶
type BinaryType ¶
type BinaryType struct{}
func DefaultBinaryType ¶
func DefaultBinaryType() *BinaryType
func (*BinaryType) CanSerializeAsString ¶
func (t *BinaryType) CanSerializeAsString() bool
func (*BinaryType) IsAssignable ¶
func (*BinaryType) IsInstance ¶
func (*BinaryType) MetaType ¶
func (t *BinaryType) MetaType() px.ObjectType
func (*BinaryType) Name ¶
func (t *BinaryType) Name() string
func (*BinaryType) PType ¶
func (t *BinaryType) PType() px.Type
func (*BinaryType) ReflectType ¶
func (*BinaryType) SerializationString ¶
func (t *BinaryType) SerializationString() string
func (*BinaryType) String ¶
func (t *BinaryType) String() string
func (*BinaryType) ToString ¶
func (t *BinaryType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type BooleanType ¶
type BooleanType struct {
// contains filtered or unexported fields
}
func DefaultBooleanType ¶
func DefaultBooleanType() *BooleanType
func NewBooleanType ¶
func NewBooleanType(value bool) *BooleanType
func (*BooleanType) CanSerializeAsString ¶
func (t *BooleanType) CanSerializeAsString() bool
func (*BooleanType) Default ¶
func (t *BooleanType) Default() px.Type
func (*BooleanType) Generic ¶
func (t *BooleanType) Generic() px.Type
func (*BooleanType) IsAssignable ¶
func (*BooleanType) IsInstance ¶
func (*BooleanType) MetaType ¶
func (t *BooleanType) MetaType() px.ObjectType
func (*BooleanType) Name ¶
func (t *BooleanType) Name() string
func (*BooleanType) PType ¶
func (t *BooleanType) PType() px.Type
func (*BooleanType) Parameters ¶
func (t *BooleanType) Parameters() []px.Value
func (*BooleanType) ReflectType ¶
func (*BooleanType) SerializationString ¶
func (t *BooleanType) SerializationString() string
func (*BooleanType) String ¶
func (t *BooleanType) String() string
func (*BooleanType) ToString ¶
func (t *BooleanType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type BuildFunctionArgs ¶
type BuildFunctionArgs struct { Name string LocalTypes px.LocalTypesCreator Creators []px.DispatchCreator }
func PopDeclaredConstructors ¶
func PopDeclaredConstructors() (ctorDecls []*BuildFunctionArgs)
type CallableType ¶
type CallableType struct {
// contains filtered or unexported fields
}
func DefaultCallableType ¶
func DefaultCallableType() *CallableType
func NewCallableType ¶
Example ¶
package main import ( "fmt" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { cc := types.NewCallableType(types.NewTupleType([]px.Type{types.DefaultUnitType()}, types.PositiveIntegerType()), nil, nil) fmt.Println(cc) }
Output: Callable[0, default]
func (*CallableType) BlockName ¶
func (t *CallableType) BlockName() string
func (*CallableType) BlockType ¶
func (t *CallableType) BlockType() px.Type
func (*CallableType) CallableWith ¶
func (*CallableType) CanSerializeAsString ¶
func (t *CallableType) CanSerializeAsString() bool
func (*CallableType) Default ¶
func (t *CallableType) Default() px.Type
func (*CallableType) Generic ¶
func (t *CallableType) Generic() px.Type
func (*CallableType) IsAssignable ¶
func (*CallableType) IsInstance ¶
func (*CallableType) MetaType ¶
func (t *CallableType) MetaType() px.ObjectType
func (*CallableType) Name ¶
func (t *CallableType) Name() string
func (*CallableType) PType ¶
func (t *CallableType) PType() px.Type
func (*CallableType) ParameterNames ¶
func (t *CallableType) ParameterNames() []string
func (*CallableType) Parameters ¶
func (t *CallableType) Parameters() (params []px.Value)
func (*CallableType) ParametersType ¶
func (t *CallableType) ParametersType() px.Type
func (*CallableType) ReturnType ¶
func (t *CallableType) ReturnType() px.Type
func (*CallableType) SerializationString ¶
func (t *CallableType) SerializationString() string
func (*CallableType) String ¶
func (t *CallableType) String() string
func (*CallableType) ToString ¶
func (t *CallableType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type CollectionType ¶
type CollectionType struct {
// contains filtered or unexported fields
}
func DefaultCollectionType ¶
func DefaultCollectionType() *CollectionType
func NewCollectionType ¶
func NewCollectionType(size *IntegerType) *CollectionType
func (*CollectionType) CanSerializeAsString ¶
func (t *CollectionType) CanSerializeAsString() bool
func (*CollectionType) Default ¶
func (t *CollectionType) Default() px.Type
func (*CollectionType) Generic ¶
func (t *CollectionType) Generic() px.Type
func (*CollectionType) IsAssignable ¶
func (*CollectionType) IsInstance ¶
func (*CollectionType) MetaType ¶
func (t *CollectionType) MetaType() px.ObjectType
func (*CollectionType) Name ¶
func (t *CollectionType) Name() string
func (*CollectionType) PType ¶
func (t *CollectionType) PType() px.Type
func (*CollectionType) Parameters ¶
func (t *CollectionType) Parameters() []px.Value
func (*CollectionType) SerializationString ¶
func (t *CollectionType) SerializationString() string
func (*CollectionType) Size ¶
func (t *CollectionType) Size() *IntegerType
func (*CollectionType) String ¶
func (t *CollectionType) String() string
func (*CollectionType) ToString ¶
func (t *CollectionType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type DefaultType ¶
type DefaultType struct{}
func DefaultDefaultType ¶
func DefaultDefaultType() *DefaultType
func (*DefaultType) CanSerializeAsString ¶
func (t *DefaultType) CanSerializeAsString() bool
func (*DefaultType) IsAssignable ¶
func (*DefaultType) IsInstance ¶
func (*DefaultType) MetaType ¶
func (t *DefaultType) MetaType() px.ObjectType
func (*DefaultType) Name ¶
func (t *DefaultType) Name() string
func (*DefaultType) PType ¶
func (t *DefaultType) PType() px.Type
func (*DefaultType) SerializationString ¶
func (t *DefaultType) SerializationString() string
func (*DefaultType) String ¶
func (t *DefaultType) String() string
func (*DefaultType) ToString ¶
func (t *DefaultType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type DefaultValue ¶
type DefaultValue struct{}
DefaultValue is an empty struct because both type and value are known
func WrapDefault ¶
func WrapDefault() *DefaultValue
func (*DefaultValue) PType ¶
func (dv *DefaultValue) PType() px.Type
func (*DefaultValue) String ¶
func (dv *DefaultValue) String() string
func (*DefaultValue) ToKey ¶
func (dv *DefaultValue) ToKey() px.HashKey
func (*DefaultValue) ToString ¶
func (dv *DefaultValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type DeferredType ¶
type DeferredType struct {
// contains filtered or unexported fields
}
func NewDeferredType ¶
func NewDeferredType(name string, params ...px.Value) *DeferredType
func (*DeferredType) Equals ¶
func (dt *DeferredType) Equals(other interface{}, guard px.Guard) bool
func (*DeferredType) Name ¶
func (dt *DeferredType) Name() string
func (*DeferredType) PType ¶
func (dt *DeferredType) PType() px.Type
func (*DeferredType) Parameters ¶
func (dt *DeferredType) Parameters() []px.Value
func (*DeferredType) String ¶
func (dt *DeferredType) String() string
func (*DeferredType) ToString ¶
func (dt *DeferredType) ToString(bld io.Writer, s px.FormatContext, g px.RDetect)
type EnumType ¶
type EnumType struct {
// contains filtered or unexported fields
}
func DefaultEnumType ¶
func DefaultEnumType() *EnumType
func NewEnumType ¶
func (*EnumType) CanSerializeAsString ¶
func (*EnumType) IsCaseInsensitive ¶
func (*EnumType) MetaType ¶
func (t *EnumType) MetaType() px.ObjectType
func (*EnumType) Parameters ¶
func (*EnumType) SerializationString ¶
type FloatType ¶
type FloatType struct {
// contains filtered or unexported fields
}
func DefaultFloatType ¶
func DefaultFloatType() *FloatType
func NewFloatType ¶
func (*FloatType) CanSerializeAsString ¶
func (*FloatType) IsUnbounded ¶
func (*FloatType) MetaType ¶
func (t *FloatType) MetaType() px.ObjectType
func (*FloatType) Parameters ¶
func (*FloatType) SerializationString ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
func IndexedFromArray ¶
func WrapHash ¶
Example ¶
package main import ( "fmt" "regexp" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { a := px.Wrap(nil, map[string]interface{}{ `foo`: 23, `fee`: `hello`, `fum`: map[string]interface{}{ `x`: `1`, `y`: []int{1, 2, 3}, `z`: regexp.MustCompile(`^[a-z]+$`)}}) e := types.WrapHash([]*types.HashEntry{ types.WrapHashEntry2(`foo`, types.WrapInteger(23)), types.WrapHashEntry2(`fee`, types.WrapString(`hello`)), types.WrapHashEntry2(`fum`, types.WrapHash([]*types.HashEntry{ types.WrapHashEntry2(`x`, types.WrapString(`1`)), types.WrapHashEntry2(`y`, types.WrapValues([]px.Value{ types.WrapInteger(1), types.WrapInteger(2), types.WrapInteger(3)})), types.WrapHashEntry2(`z`, types.WrapRegexp(`^[a-z]+$`))}))}) fmt.Println(e.Equals(a, nil)) }
Output: true
func WrapHashFromArray ¶
func WrapStringPValue ¶
func WrapStringPValue(hash hash.StringHash) *Hash
func WrapStringToInterfaceMap ¶
WrapStringToInterfaceMap does not preserve order since order is undefined in a Go map
func WrapStringToStringMap ¶
WrapStringToStringMap does not preserve order since order is undefined in a Go map
func WrapStringToTypeMap ¶
WrapStringToTypeMap builds an ordered map from adds all entries in the given map
func WrapStringToValueMap ¶
WrapStringToValueMap builds an ordered map from adds all entries in the given map
func (*Hash) AllKeysAreStrings ¶
func (*Hash) AppendEntriesTo ¶
func (*Hash) DetailedType ¶
func (*Hash) EachPair ¶
func (hv *Hash) EachPair(consumer px.BiConsumer)
func (*Hash) EachWithIndex ¶
func (hv *Hash) EachWithIndex(consumer px.IndexedConsumer)
func (*Hash) ElementType ¶
func (*Hash) IncludesKey2 ¶
func (*Hash) IsHashStyle ¶
func (*Hash) MapEntries ¶
func (hv *Hash) MapEntries(mapper px.EntryMapper) px.OrderedMap
func (*Hash) Merge ¶
func (hv *Hash) Merge(o px.OrderedMap) px.OrderedMap
func (*Hash) RejectPairs ¶
func (hv *Hash) RejectPairs(predicate px.BiPredicate) px.OrderedMap
func (*Hash) SelectPairs ¶
func (hv *Hash) SelectPairs(predicate px.BiPredicate) px.OrderedMap
func (*Hash) Sort ¶
func (hv *Hash) Sort(comparator px.Comparator) px.List
Sort reorders the associations of this hash by applying the comparator to the keys
type HashEntry ¶
type HashEntry struct {
// contains filtered or unexported fields
}
func (*HashEntry) DetailedType ¶
func (*HashEntry) EachWithIndex ¶
func (he *HashEntry) EachWithIndex(consumer px.IndexedConsumer)
func (*HashEntry) ElementType ¶
func (*HashEntry) IsHashStyle ¶
type HashType ¶
type HashType struct {
// contains filtered or unexported fields
}
func DefaultHashType ¶
func DefaultHashType() *HashType
func EmptyHashType ¶
func EmptyHashType() *HashType
func NewHashType ¶
func (*HashType) CanSerializeAsString ¶
func (*HashType) MetaType ¶
func (t *HashType) MetaType() px.ObjectType
func (*HashType) Parameters ¶
func (*HashType) SerializationString ¶
func (*HashType) Size ¶
func (t *HashType) Size() *IntegerType
type InitType ¶
type InitType struct {
// contains filtered or unexported fields
}
func DefaultInitType ¶
func DefaultInitType() *InitType
func (*InitType) CanSerializeAsString ¶
func (*InitType) EachSignature ¶
func (*InitType) IsAssignable ¶
IsAssignable answers the question if a value of the given type can be used when instantiating an instance of the contained type
func (*InitType) IsInstance ¶
IsInstance answers the question if the given value can be used when instantiating an instance of the contained type
func (*InitType) MetaType ¶
func (t *InitType) MetaType() px.ObjectType
func (*InitType) Parameters ¶
func (*InitType) SerializationString ¶
type IntegerType ¶
type IntegerType struct {
// contains filtered or unexported fields
}
func DefaultIntegerType ¶
func DefaultIntegerType() *IntegerType
func NewIntegerType ¶
func NewIntegerType(min int64, max int64) *IntegerType
func PositiveIntegerType ¶
func PositiveIntegerType() *IntegerType
func (*IntegerType) CanSerializeAsString ¶
func (t *IntegerType) CanSerializeAsString() bool
func (*IntegerType) Default ¶
func (t *IntegerType) Default() px.Type
func (*IntegerType) Generic ¶
func (t *IntegerType) Generic() px.Type
func (*IntegerType) IsAssignable ¶
func (*IntegerType) IsInstance ¶
func (*IntegerType) IsInstance2 ¶
func (t *IntegerType) IsInstance2(n int64) bool
func (*IntegerType) IsInstance3 ¶
func (t *IntegerType) IsInstance3(n int) bool
func (*IntegerType) IsUnbounded ¶
func (t *IntegerType) IsUnbounded() bool
func (*IntegerType) Max ¶
func (t *IntegerType) Max() int64
func (*IntegerType) MetaType ¶
func (t *IntegerType) MetaType() px.ObjectType
func (*IntegerType) Min ¶
func (t *IntegerType) Min() int64
func (*IntegerType) Name ¶
func (t *IntegerType) Name() string
func (*IntegerType) PType ¶
func (t *IntegerType) PType() px.Type
func (*IntegerType) Parameters ¶
func (t *IntegerType) Parameters() []px.Value
func (*IntegerType) ReflectType ¶
func (*IntegerType) SerializationString ¶
func (t *IntegerType) SerializationString() string
func (*IntegerType) SizeParameters ¶
func (t *IntegerType) SizeParameters() []px.Value
func (*IntegerType) String ¶
func (t *IntegerType) String() string
func (*IntegerType) ToString ¶
func (t *IntegerType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type IterableType ¶
type IterableType struct {
// contains filtered or unexported fields
}
func DefaultIterableType ¶
func DefaultIterableType() *IterableType
func NewIterableType ¶
func NewIterableType(elementType px.Type) *IterableType
func (*IterableType) CanSerializeAsString ¶
func (t *IterableType) CanSerializeAsString() bool
func (*IterableType) Default ¶
func (t *IterableType) Default() px.Type
func (*IterableType) ElementType ¶
func (t *IterableType) ElementType() px.Type
func (*IterableType) Generic ¶
func (t *IterableType) Generic() px.Type
func (*IterableType) IsAssignable ¶
func (*IterableType) IsInstance ¶
func (*IterableType) MetaType ¶
func (t *IterableType) MetaType() px.ObjectType
func (*IterableType) Name ¶
func (t *IterableType) Name() string
func (*IterableType) PType ¶
func (t *IterableType) PType() px.Type
func (*IterableType) Parameters ¶
func (t *IterableType) Parameters() []px.Value
func (*IterableType) SerializationString ¶
func (t *IterableType) SerializationString() string
func (*IterableType) String ¶
func (t *IterableType) String() string
func (*IterableType) ToString ¶
func (t *IterableType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type IteratorType ¶
type IteratorType struct {
// contains filtered or unexported fields
}
func DefaultIteratorType ¶
func DefaultIteratorType() *IteratorType
func NewIteratorType ¶
func NewIteratorType(elementType px.Type) *IteratorType
func (*IteratorType) CanSerializeAsString ¶
func (t *IteratorType) CanSerializeAsString() bool
func (*IteratorType) Default ¶
func (t *IteratorType) Default() px.Type
func (*IteratorType) ElementType ¶
func (t *IteratorType) ElementType() px.Type
func (*IteratorType) Generic ¶
func (t *IteratorType) Generic() px.Type
func (*IteratorType) IsAssignable ¶
func (*IteratorType) IsInstance ¶
func (*IteratorType) MetaType ¶
func (t *IteratorType) MetaType() px.ObjectType
func (*IteratorType) Name ¶
func (t *IteratorType) Name() string
func (*IteratorType) PType ¶
func (t *IteratorType) PType() px.Type
func (*IteratorType) Parameters ¶
func (t *IteratorType) Parameters() []px.Value
func (*IteratorType) SerializationString ¶
func (t *IteratorType) SerializationString() string
func (*IteratorType) String ¶
func (t *IteratorType) String() string
func (*IteratorType) ToString ¶
func (t *IteratorType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type LikeType ¶
type LikeType struct {
// contains filtered or unexported fields
}
func DefaultLikeType ¶
func DefaultLikeType() *LikeType
func (*LikeType) MetaType ¶
func (t *LikeType) MetaType() px.ObjectType
func (*LikeType) Parameters ¶
type Mapping ¶
func PopDeclaredMappings ¶
func PopDeclaredMappings() (types []Mapping)
type MutableHashValue ¶
type MutableHashValue struct {
Hash
}
func NewMutableHash ¶
func NewMutableHash() *MutableHashValue
func (*MutableHashValue) Put ¶
func (hv *MutableHashValue) Put(key, value px.Value)
Put adds or replaces the given key/value association in this hash
func (*MutableHashValue) PutAll ¶
func (hv *MutableHashValue) PutAll(o px.OrderedMap)
PutAll merges the given hash into this hash (mutates the hash). The method is not thread safe
type NotUndefType ¶
type NotUndefType struct {
// contains filtered or unexported fields
}
func DefaultNotUndefType ¶
func DefaultNotUndefType() *NotUndefType
func NewNotUndefType ¶
func NewNotUndefType(containedType px.Type) *NotUndefType
func (*NotUndefType) CanSerializeAsString ¶
func (t *NotUndefType) CanSerializeAsString() bool
func (*NotUndefType) ContainedType ¶
func (t *NotUndefType) ContainedType() px.Type
func (*NotUndefType) Default ¶
func (t *NotUndefType) Default() px.Type
func (*NotUndefType) Generic ¶
func (t *NotUndefType) Generic() px.Type
func (*NotUndefType) IsAssignable ¶
func (*NotUndefType) IsInstance ¶
func (*NotUndefType) MetaType ¶
func (t *NotUndefType) MetaType() px.ObjectType
func (*NotUndefType) Name ¶
func (t *NotUndefType) Name() string
func (*NotUndefType) PType ¶
func (t *NotUndefType) PType() px.Type
func (*NotUndefType) Parameters ¶
func (t *NotUndefType) Parameters() []px.Value
func (*NotUndefType) ReflectType ¶
func (*NotUndefType) SerializationString ¶
func (t *NotUndefType) SerializationString() string
func (*NotUndefType) String ¶
func (t *NotUndefType) String() string
func (*NotUndefType) ToString ¶
func (t *NotUndefType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type NumericType ¶
type NumericType struct{}
func DefaultNumericType ¶
func DefaultNumericType() *NumericType
func (*NumericType) CanSerializeAsString ¶
func (t *NumericType) CanSerializeAsString() bool
func (*NumericType) IsAssignable ¶
func (*NumericType) IsInstance ¶
func (*NumericType) MetaType ¶
func (t *NumericType) MetaType() px.ObjectType
func (*NumericType) Name ¶
func (t *NumericType) Name() string
func (*NumericType) PType ¶
func (t *NumericType) PType() px.Type
func (*NumericType) ReflectType ¶
func (*NumericType) SerializationString ¶
func (t *NumericType) SerializationString() string
func (*NumericType) String ¶
func (t *NumericType) String() string
func (*NumericType) ToString ¶
func (t *NumericType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type OptionalType ¶
type OptionalType struct {
// contains filtered or unexported fields
}
func DefaultOptionalType ¶
func DefaultOptionalType() *OptionalType
func NewOptionalType ¶
func NewOptionalType(containedType px.Type) *OptionalType
func (*OptionalType) CanSerializeAsString ¶
func (t *OptionalType) CanSerializeAsString() bool
func (*OptionalType) ContainedType ¶
func (t *OptionalType) ContainedType() px.Type
func (*OptionalType) Default ¶
func (t *OptionalType) Default() px.Type
func (*OptionalType) Generic ¶
func (t *OptionalType) Generic() px.Type
func (*OptionalType) IsAssignable ¶
func (*OptionalType) IsInstance ¶
func (*OptionalType) MetaType ¶
func (t *OptionalType) MetaType() px.ObjectType
func (*OptionalType) Name ¶
func (t *OptionalType) Name() string
func (*OptionalType) PType ¶
func (t *OptionalType) PType() px.Type
func (*OptionalType) Parameters ¶
func (t *OptionalType) Parameters() []px.Value
func (*OptionalType) ReflectType ¶
func (*OptionalType) SerializationString ¶
func (t *OptionalType) SerializationString() string
func (*OptionalType) String ¶
func (t *OptionalType) String() string
func (*OptionalType) ToString ¶
func (t *OptionalType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type PatternType ¶
type PatternType struct {
// contains filtered or unexported fields
}
func DefaultPatternType ¶
func DefaultPatternType() *PatternType
func NewPatternType ¶
func NewPatternType(regexps []*RegexpType) *PatternType
func (*PatternType) CanSerializeAsString ¶
func (t *PatternType) CanSerializeAsString() bool
func (*PatternType) Default ¶
func (t *PatternType) Default() px.Type
func (*PatternType) IsAssignable ¶
func (*PatternType) IsInstance ¶
func (*PatternType) MetaType ¶
func (t *PatternType) MetaType() px.ObjectType
func (*PatternType) Name ¶
func (t *PatternType) Name() string
func (*PatternType) PType ¶
func (t *PatternType) PType() px.Type
func (*PatternType) Parameters ¶
func (t *PatternType) Parameters() []px.Value
func (*PatternType) Patterns ¶
func (t *PatternType) Patterns() *Array
func (*PatternType) ReflectType ¶
func (*PatternType) SerializationString ¶
func (t *PatternType) SerializationString() string
func (*PatternType) String ¶
func (t *PatternType) String() string
func (*PatternType) ToString ¶
func (t *PatternType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type Regexp ¶
type Regexp RegexpType
Regexp represents RegexpType as a value
func WrapRegexp ¶
func WrapRegexp2 ¶
func (*Regexp) PatternString ¶
type RegexpType ¶
type RegexpType struct {
// contains filtered or unexported fields
}
func DefaultRegexpType ¶
func DefaultRegexpType() *RegexpType
func NewRegexpType ¶
func NewRegexpType(patternString string) *RegexpType
func NewRegexpTypeR ¶
func NewRegexpTypeR(pattern *regexp.Regexp) *RegexpType
func UniqueRegexps ¶
func UniqueRegexps(regexpTypes []*RegexpType) []*RegexpType
func (*RegexpType) CanSerializeAsString ¶
func (t *RegexpType) CanSerializeAsString() bool
func (*RegexpType) Default ¶
func (t *RegexpType) Default() px.Type
func (*RegexpType) IsAssignable ¶
func (*RegexpType) IsInstance ¶
func (*RegexpType) MetaType ¶
func (t *RegexpType) MetaType() px.ObjectType
func (*RegexpType) Name ¶
func (t *RegexpType) Name() string
func (*RegexpType) PType ¶
func (t *RegexpType) PType() px.Type
func (*RegexpType) Parameters ¶
func (t *RegexpType) Parameters() []px.Value
func (*RegexpType) PatternString ¶
func (t *RegexpType) PatternString() string
func (*RegexpType) ReflectType ¶
func (*RegexpType) Regexp ¶
func (t *RegexpType) Regexp() *regexp.Regexp
func (*RegexpType) SerializationString ¶
func (t *RegexpType) SerializationString() string
func (*RegexpType) String ¶
func (t *RegexpType) String() string
func (*RegexpType) ToString ¶
func (t *RegexpType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type RuntimeType ¶
type RuntimeType struct {
// contains filtered or unexported fields
}
func DefaultRuntimeType ¶
func DefaultRuntimeType() *RuntimeType
func NewGoRuntimeType ¶
func NewGoRuntimeType(value interface{}) *RuntimeType
NewGoRuntimeType creates a Go runtime by extracting the element type of the given value.
A Go interface must be registered by passing a Pointer to a nil of the interface so to create an Runtime for the interface Foo, use NewGoRuntimeType((*Foo)(nil))
func NewRuntimeType ¶
func NewRuntimeType(runtimeName string, name string, pattern *RegexpType) *RuntimeType
func (*RuntimeType) CanSerializeAsString ¶
func (t *RuntimeType) CanSerializeAsString() bool
func (*RuntimeType) Default ¶
func (t *RuntimeType) Default() px.Type
func (*RuntimeType) Generic ¶
func (t *RuntimeType) Generic() px.Type
func (*RuntimeType) IsAssignable ¶
func (*RuntimeType) IsInstance ¶
func (*RuntimeType) MetaType ¶
func (t *RuntimeType) MetaType() px.ObjectType
func (*RuntimeType) Name ¶
func (t *RuntimeType) Name() string
func (*RuntimeType) PType ¶
func (t *RuntimeType) PType() px.Type
func (*RuntimeType) Parameters ¶
func (t *RuntimeType) Parameters() []px.Value
func (*RuntimeType) ReflectType ¶
func (*RuntimeType) SerializationString ¶
func (t *RuntimeType) SerializationString() string
func (*RuntimeType) String ¶
func (t *RuntimeType) String() string
func (*RuntimeType) ToString ¶
func (t *RuntimeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type RuntimeValue ¶
type RuntimeValue struct {
// contains filtered or unexported fields
}
RuntimeValue Captures values of all types unknown to Puppet
func WrapRuntime ¶
func WrapRuntime(value interface{}) *RuntimeValue
func (*RuntimeValue) Interface ¶
func (rv *RuntimeValue) Interface() interface{}
func (*RuntimeValue) PType ¶
func (rv *RuntimeValue) PType() px.Type
func (*RuntimeValue) ReflectTo ¶
func (rv *RuntimeValue) ReflectTo(c px.Context, dest reflect.Value)
func (*RuntimeValue) String ¶
func (rv *RuntimeValue) String() string
func (*RuntimeValue) ToString ¶
func (rv *RuntimeValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type ScalarDataType ¶
type ScalarDataType struct{}
func DefaultScalarDataType ¶
func DefaultScalarDataType() *ScalarDataType
func (*ScalarDataType) CanSerializeAsString ¶
func (t *ScalarDataType) CanSerializeAsString() bool
func (*ScalarDataType) IsAssignable ¶
func (*ScalarDataType) IsInstance ¶
func (*ScalarDataType) MetaType ¶
func (t *ScalarDataType) MetaType() px.ObjectType
func (*ScalarDataType) Name ¶
func (t *ScalarDataType) Name() string
func (*ScalarDataType) PType ¶
func (t *ScalarDataType) PType() px.Type
func (*ScalarDataType) SerializationString ¶
func (t *ScalarDataType) SerializationString() string
func (*ScalarDataType) String ¶
func (t *ScalarDataType) String() string
func (*ScalarDataType) ToString ¶
func (t *ScalarDataType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type ScalarType ¶
type ScalarType struct{}
func DefaultScalarType ¶
func DefaultScalarType() *ScalarType
func (*ScalarType) CanSerializeAsString ¶
func (t *ScalarType) CanSerializeAsString() bool
func (*ScalarType) IsAssignable ¶
func (*ScalarType) IsInstance ¶
func (*ScalarType) MetaType ¶
func (t *ScalarType) MetaType() px.ObjectType
func (*ScalarType) Name ¶
func (t *ScalarType) Name() string
func (*ScalarType) PType ¶
func (t *ScalarType) PType() px.Type
func (*ScalarType) SerializationString ¶
func (t *ScalarType) SerializationString() string
func (*ScalarType) String ¶
func (t *ScalarType) String() string
func (*ScalarType) ToString ¶
func (t *ScalarType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type SemVer ¶
type SemVer SemVerType
func WrapSemVer ¶
func (*SemVer) CanSerializeAsString ¶
func (*SemVer) SerializationString ¶
type SemVerRange ¶
type SemVerRange struct {
// contains filtered or unexported fields
}
func WrapSemVerRange ¶
func WrapSemVerRange(val semver.VersionRange) *SemVerRange
func (*SemVerRange) CanSerializeAsString ¶
func (bv *SemVerRange) CanSerializeAsString() bool
func (*SemVerRange) PType ¶
func (bv *SemVerRange) PType() px.Type
func (*SemVerRange) SerializationString ¶
func (bv *SemVerRange) SerializationString() string
func (*SemVerRange) String ¶
func (bv *SemVerRange) String() string
func (*SemVerRange) ToKey ¶
func (bv *SemVerRange) ToKey(b *bytes.Buffer)
func (*SemVerRange) ToString ¶
func (bv *SemVerRange) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
func (*SemVerRange) VersionRange ¶
func (bv *SemVerRange) VersionRange() semver.VersionRange
type SemVerRangeType ¶
type SemVerRangeType struct{}
func DefaultSemVerRangeType ¶
func DefaultSemVerRangeType() *SemVerRangeType
func (*SemVerRangeType) CanSerializeAsString ¶
func (t *SemVerRangeType) CanSerializeAsString() bool
func (*SemVerRangeType) IsAssignable ¶
func (*SemVerRangeType) IsInstance ¶
func (*SemVerRangeType) MetaType ¶
func (t *SemVerRangeType) MetaType() px.ObjectType
func (*SemVerRangeType) Name ¶
func (t *SemVerRangeType) Name() string
func (*SemVerRangeType) PType ¶
func (t *SemVerRangeType) PType() px.Type
func (*SemVerRangeType) ReflectType ¶
func (*SemVerRangeType) SerializationString ¶
func (t *SemVerRangeType) SerializationString() string
func (*SemVerRangeType) String ¶
func (t *SemVerRangeType) String() string
func (*SemVerRangeType) ToString ¶
func (t *SemVerRangeType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type SemVerType ¶
type SemVerType struct {
// contains filtered or unexported fields
}
func DefaultSemVerType ¶
func DefaultSemVerType() *SemVerType
func NewSemVerType ¶
func NewSemVerType(vr semver.VersionRange) *SemVerType
func (*SemVerType) CanSerializeAsString ¶
func (t *SemVerType) CanSerializeAsString() bool
func (*SemVerType) Default ¶
func (t *SemVerType) Default() px.Type
func (*SemVerType) IsAssignable ¶
func (*SemVerType) IsInstance ¶
func (*SemVerType) MetaType ¶
func (t *SemVerType) MetaType() px.ObjectType
func (*SemVerType) Name ¶
func (t *SemVerType) Name() string
func (*SemVerType) PType ¶
func (t *SemVerType) PType() px.Type
func (*SemVerType) Parameters ¶
func (t *SemVerType) Parameters() []px.Value
func (*SemVerType) ReflectType ¶
func (*SemVerType) SerializationString ¶
func (t *SemVerType) SerializationString() string
func (*SemVerType) String ¶
func (t *SemVerType) String() string
func (*SemVerType) ToString ¶
func (t *SemVerType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type SensitiveType ¶
type SensitiveType struct {
// contains filtered or unexported fields
}
func DefaultSensitiveType ¶
func DefaultSensitiveType() *SensitiveType
func NewSensitiveType ¶
func NewSensitiveType(containedType px.Type) *SensitiveType
func (*SensitiveType) CanSerializeAsString ¶
func (t *SensitiveType) CanSerializeAsString() bool
func (*SensitiveType) ContainedType ¶
func (t *SensitiveType) ContainedType() px.Type
func (*SensitiveType) Default ¶
func (t *SensitiveType) Default() px.Type
func (*SensitiveType) Generic ¶
func (t *SensitiveType) Generic() px.Type
func (*SensitiveType) IsAssignable ¶
func (*SensitiveType) IsInstance ¶
func (*SensitiveType) MetaType ¶
func (t *SensitiveType) MetaType() px.ObjectType
func (*SensitiveType) Name ¶
func (t *SensitiveType) Name() string
func (*SensitiveType) PType ¶
func (t *SensitiveType) PType() px.Type
func (*SensitiveType) Parameters ¶
func (t *SensitiveType) Parameters() []px.Value
func (*SensitiveType) ReflectType ¶
func (*SensitiveType) SerializationString ¶
func (t *SensitiveType) SerializationString() string
func (*SensitiveType) String ¶
func (t *SensitiveType) String() string
func (*SensitiveType) ToString ¶
func (t *SensitiveType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type StructElement ¶
type StructElement struct {
// contains filtered or unexported fields
}
func NewStructElement ¶
func NewStructElement(key px.Value, value px.Type) *StructElement
func (*StructElement) ActualKeyType ¶
func (s *StructElement) ActualKeyType() px.Type
func (*StructElement) Key ¶
func (s *StructElement) Key() px.Type
func (*StructElement) Name ¶
func (s *StructElement) Name() string
func (*StructElement) Optional ¶
func (s *StructElement) Optional() bool
func (*StructElement) PType ¶
func (s *StructElement) PType() px.Type
func (*StructElement) String ¶
func (s *StructElement) String() string
func (*StructElement) ToString ¶
func (s *StructElement) ToString(bld io.Writer, format px.FormatContext, g px.RDetect)
func (*StructElement) Value ¶
func (s *StructElement) Value() px.Type
type StructType ¶
type StructType struct {
// contains filtered or unexported fields
}
func DefaultStructType ¶
func DefaultStructType() *StructType
func NewStructType ¶
func NewStructType(elements []*StructElement) *StructType
func (*StructType) CanSerializeAsString ¶
func (t *StructType) CanSerializeAsString() bool
func (*StructType) Default ¶
func (t *StructType) Default() px.Type
func (*StructType) Elements ¶
func (t *StructType) Elements() []*StructElement
func (*StructType) Generic ¶
func (t *StructType) Generic() px.Type
func (*StructType) HashedMembers ¶
func (t *StructType) HashedMembers() map[string]*StructElement
func (*StructType) HashedMembersCloned ¶
func (t *StructType) HashedMembersCloned() map[string]*StructElement
func (*StructType) IsAssignable ¶
func (*StructType) IsInstance ¶
func (*StructType) MetaType ¶
func (t *StructType) MetaType() px.ObjectType
func (*StructType) Name ¶
func (t *StructType) Name() string
func (*StructType) PType ¶
func (t *StructType) PType() px.Type
func (*StructType) Parameters ¶
func (t *StructType) Parameters() []px.Value
func (*StructType) SerializationString ¶
func (t *StructType) SerializationString() string
func (*StructType) Size ¶
func (t *StructType) Size() *IntegerType
func (*StructType) String ¶
func (t *StructType) String() string
func (*StructType) ToString ¶
func (t *StructType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type Timespan ¶
Timespan represents time.Duration as an pcore.Value
func ParseTimespan ¶
func ParseTimespan(str string, formats []*TimespanFormat) Timespan
func WrapTimespan ¶
func (Timespan) CanSerializeAsString ¶
func (Timespan) Milliseconds ¶
Seconds returns a positive integer, 0 - 999 denoting milliseconds of second
func (Timespan) SerializationString ¶
type TimespanFormat ¶
type TimespanFormat struct {
// contains filtered or unexported fields
}
type TimespanFormatParser ¶
type TimespanFormatParser struct {
// contains filtered or unexported fields
}
var DefaultTimespanFormatParser *TimespanFormatParser
func NewTimespanFormatParser ¶
func NewTimespanFormatParser() *TimespanFormatParser
func (*TimespanFormatParser) ParseFormat ¶
func (p *TimespanFormatParser) ParseFormat(format string) *TimespanFormat
type TimespanType ¶
type TimespanType struct {
// contains filtered or unexported fields
}
func DefaultTimespanType ¶
func DefaultTimespanType() *TimespanType
func NewTimespanType ¶
func NewTimespanType(min time.Duration, max time.Duration) *TimespanType
func (*TimespanType) CanSerializeAsString ¶
func (t *TimespanType) CanSerializeAsString() bool
func (*TimespanType) Default ¶
func (t *TimespanType) Default() px.Type
func (*TimespanType) IsAssignable ¶
func (*TimespanType) IsInstance ¶
func (*TimespanType) MetaType ¶
func (t *TimespanType) MetaType() px.ObjectType
func (*TimespanType) Name ¶
func (t *TimespanType) Name() string
func (*TimespanType) PType ¶
func (t *TimespanType) PType() px.Type
func (*TimespanType) Parameters ¶
func (t *TimespanType) Parameters() []px.Value
func (*TimespanType) ReflectType ¶
func (*TimespanType) SerializationString ¶
func (t *TimespanType) SerializationString() string
func (*TimespanType) String ¶
func (t *TimespanType) String() string
func (*TimespanType) ToString ¶
func (t *TimespanType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type Timestamp ¶
Timestamp represents TimestampType as a value
func ParseTimestamp ¶
func ParseTimestamp(str string, formats []*TimestampFormat, tz string) *Timestamp
func WrapTimestamp ¶
func (*Timestamp) CanSerializeAsString ¶
func (*Timestamp) SerializationString ¶
type TimestampFormat ¶
type TimestampFormat struct {
// contains filtered or unexported fields
}
func (*TimestampFormat) Format ¶
func (f *TimestampFormat) Format(t *Timestamp) string
type TimestampFormatParser ¶
type TimestampFormatParser struct {
// contains filtered or unexported fields
}
var DefaultTimestampFormatParser *TimestampFormatParser
func NewTimestampFormatParser ¶
func NewTimestampFormatParser() *TimestampFormatParser
func (*TimestampFormatParser) ParseFormat ¶
func (p *TimestampFormatParser) ParseFormat(format string) *TimestampFormat
type TimestampType ¶
type TimestampType struct {
// contains filtered or unexported fields
}
func DefaultTimestampType ¶
func DefaultTimestampType() *TimestampType
func NewTimestampType ¶
func NewTimestampType(min time.Time, max time.Time) *TimestampType
func (*TimestampType) CanSerializeAsString ¶
func (t *TimestampType) CanSerializeAsString() bool
func (*TimestampType) Default ¶
func (t *TimestampType) Default() px.Type
func (*TimestampType) Equals ¶
func (t *TimestampType) Equals(other interface{}, guard px.Guard) bool
func (*TimestampType) IsAssignable ¶
func (*TimestampType) IsInstance ¶
func (*TimestampType) MetaType ¶
func (t *TimestampType) MetaType() px.ObjectType
func (*TimestampType) Name ¶
func (t *TimestampType) Name() string
func (*TimestampType) PType ¶
func (t *TimestampType) PType() px.Type
func (*TimestampType) Parameters ¶
func (t *TimestampType) Parameters() []px.Value
func (*TimestampType) ReflectType ¶
func (*TimestampType) SerializationString ¶
func (t *TimestampType) SerializationString() string
func (*TimestampType) String ¶
func (t *TimestampType) String() string
func (*TimestampType) ToString ¶
func (t *TimestampType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type TupleType ¶
type TupleType struct {
// contains filtered or unexported fields
}
func DefaultTupleType ¶
func DefaultTupleType() *TupleType
func EmptyTupleType ¶
func EmptyTupleType() *TupleType
func NewTupleType ¶
func NewTupleType(types []px.Type, size *IntegerType) *TupleType
Example ¶
package main import ( "fmt" "github.com/lyraproj/pcore/px" "github.com/lyraproj/pcore/types" ) func main() { tuple := types.NewTupleType([]px.Type{types.DefaultStringType(), types.DefaultIntegerType()}, nil) fmt.Println(tuple) }
Output: Tuple[String, Integer]
func (*TupleType) CanSerializeAsString ¶
func (*TupleType) CommonElementType ¶
func (*TupleType) MetaType ¶
func (t *TupleType) MetaType() px.ObjectType
func (*TupleType) Parameters ¶
func (*TupleType) SerializationString ¶
func (*TupleType) Size ¶
func (t *TupleType) Size() *IntegerType
type TypeAliasType ¶
type TypeAliasType struct {
// contains filtered or unexported fields
}
func DefaultDataType ¶
func DefaultDataType() *TypeAliasType
func DefaultRichDataType ¶
func DefaultRichDataType() *TypeAliasType
func DefaultTypeAliasType ¶
func DefaultTypeAliasType() *TypeAliasType
func NewTypeAliasType ¶
func NewTypeAliasType(name string, typeExpression *DeferredType, resolvedType px.Type) *TypeAliasType
NewTypeAliasType creates a new TypeAliasType from a name and a typeExpression which must either be a *DeferredType, a parser.Expression, or nil. If it is nil, the resolved Type must be given.
func (*TypeAliasType) Default ¶
func (t *TypeAliasType) Default() px.Type
func (*TypeAliasType) IsAssignable ¶
func (*TypeAliasType) IsInstance ¶
func (*TypeAliasType) Loader ¶
func (t *TypeAliasType) Loader() px.Loader
func (*TypeAliasType) MetaType ¶
func (t *TypeAliasType) MetaType() px.ObjectType
func (*TypeAliasType) Name ¶
func (t *TypeAliasType) Name() string
func (*TypeAliasType) PType ¶
func (t *TypeAliasType) PType() px.Type
func (*TypeAliasType) ResolvedType ¶
func (t *TypeAliasType) ResolvedType() px.Type
func (*TypeAliasType) String ¶
func (t *TypeAliasType) String() string
func (*TypeAliasType) ToString ¶
func (t *TypeAliasType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type TypeReferenceType ¶
type TypeReferenceType struct {
// contains filtered or unexported fields
}
func DefaultTypeReferenceType ¶
func DefaultTypeReferenceType() *TypeReferenceType
func NewTypeReferenceType ¶
func NewTypeReferenceType(typeString string) *TypeReferenceType
func (*TypeReferenceType) CanSerializeAsString ¶
func (t *TypeReferenceType) CanSerializeAsString() bool
func (*TypeReferenceType) Default ¶
func (t *TypeReferenceType) Default() px.Type
func (*TypeReferenceType) Equals ¶
func (t *TypeReferenceType) Equals(o interface{}, g px.Guard) bool
func (*TypeReferenceType) IsAssignable ¶
func (*TypeReferenceType) IsInstance ¶
func (*TypeReferenceType) MetaType ¶
func (t *TypeReferenceType) MetaType() px.ObjectType
func (*TypeReferenceType) Name ¶
func (t *TypeReferenceType) Name() string
func (*TypeReferenceType) PType ¶
func (t *TypeReferenceType) PType() px.Type
func (*TypeReferenceType) Parameters ¶
func (t *TypeReferenceType) Parameters() []px.Value
func (*TypeReferenceType) SerializationString ¶
func (t *TypeReferenceType) SerializationString() string
func (*TypeReferenceType) String ¶
func (t *TypeReferenceType) String() string
func (*TypeReferenceType) ToString ¶
func (t *TypeReferenceType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
func (*TypeReferenceType) TypeString ¶
func (t *TypeReferenceType) TypeString() string
type TypeType ¶
type TypeType struct {
// contains filtered or unexported fields
}
func DefaultTypeType ¶
func DefaultTypeType() *TypeType
func NewTypeType ¶
func (*TypeType) CanSerializeAsString ¶
func (*TypeType) ContainedType ¶
func (*TypeType) MetaType ¶
func (t *TypeType) MetaType() px.ObjectType
func (*TypeType) Parameters ¶
func (*TypeType) SerializationString ¶
type UndefType ¶
type UndefType struct{}
func DefaultUndefType ¶
func DefaultUndefType() *UndefType
func (*UndefType) CanSerializeAsString ¶
func (*UndefType) MetaType ¶
func (t *UndefType) MetaType() px.ObjectType
func (*UndefType) SerializationString ¶
type UndefValue ¶
type UndefValue struct{}
UndefValue is an empty struct because both type and value are known
func WrapUndef ¶
func WrapUndef() *UndefValue
func (*UndefValue) MarshalJSON ¶
func (uv *UndefValue) MarshalJSON() ([]byte, error)
func (*UndefValue) MarshalYAML ¶
func (uv *UndefValue) MarshalYAML() (interface{}, error)
func (*UndefValue) PType ¶
func (uv *UndefValue) PType() px.Type
func (*UndefValue) String ¶
func (uv *UndefValue) String() string
func (*UndefValue) ToKey ¶
func (uv *UndefValue) ToKey() px.HashKey
func (*UndefValue) ToString ¶
func (uv *UndefValue) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
type UnitType ¶
type UnitType struct{}
func DefaultUnitType ¶
func DefaultUnitType() *UnitType
func (*UnitType) CanSerializeAsString ¶
func (*UnitType) MetaType ¶
func (t *UnitType) MetaType() px.ObjectType
func (*UnitType) SerializationString ¶
type UriType ¶
type UriType struct {
// contains filtered or unexported fields
}
func DefaultUriType ¶
func DefaultUriType() *UriType
func NewUriType ¶
func (*UriType) CanSerializeAsString ¶
func (*UriType) MetaType ¶
func (t *UriType) MetaType() px.ObjectType
func (*UriType) Parameters ¶
func (*UriType) SerializationString ¶
type UriValue ¶
type UriValue struct {
UriType
}
func (*UriValue) CanSerializeAsString ¶
func (*UriValue) SerializationString ¶
type VariantType ¶
type VariantType struct {
// contains filtered or unexported fields
}
func DefaultVariantType ¶
func DefaultVariantType() *VariantType
func (*VariantType) CanSerializeAsString ¶
func (t *VariantType) CanSerializeAsString() bool
func (*VariantType) Default ¶
func (t *VariantType) Default() px.Type
func (*VariantType) Generic ¶
func (t *VariantType) Generic() px.Type
func (*VariantType) IsAssignable ¶
func (*VariantType) IsInstance ¶
func (*VariantType) MetaType ¶
func (t *VariantType) MetaType() px.ObjectType
func (*VariantType) Name ¶
func (t *VariantType) Name() string
func (*VariantType) PType ¶
func (t *VariantType) PType() px.Type
func (*VariantType) Parameters ¶
func (t *VariantType) Parameters() []px.Value
func (*VariantType) SerializationString ¶
func (t *VariantType) SerializationString() string
func (*VariantType) String ¶
func (t *VariantType) String() string
func (*VariantType) ToString ¶
func (t *VariantType) ToString(b io.Writer, s px.FormatContext, g px.RDetect)
func (*VariantType) Types ¶
func (t *VariantType) Types() []px.Type
Source Files
¶
- annotatable.go
- annotatedmember.go
- anytype.go
- arraytype.go
- attribute.go
- attributesinfo.go
- basiccollector.go
- binarytype.go
- booleantype.go
- callabletype.go
- coerce.go
- collectiontype.go
- commonality.go
- constants.go
- conversions.go
- defaulttype.go
- deferred.go
- deferredtype.go
- enumtype.go
- floattype.go
- format.go
- function.go
- hashtype.go
- inittype.go
- integertype.go
- iterabletype.go
- iteratortype.go
- lexer.go
- liketype.go
- notundeftype.go
- numerictype.go
- objecttype.go
- objecttypeextension.go
- objectvalue.go
- optionaltype.go
- parser.go
- patterntype.go
- reflector.go
- regexptype.go
- resolver.go
- runtimetype.go
- scalardatatype.go
- scalartype.go
- semverrangetype.go
- semvertype.go
- sensitivetype.go
- stringtype.go
- structtype.go
- taggedtype.go
- timespantype.go
- timestamptype.go
- tupletype.go
- typealiastype.go
- typedname.go
- typeparameter.go
- typereferencetype.go
- types.go
- typeset.go
- typetype.go
- undeftype.go
- unittype.go
- uritype.go
- varianttype.go
- zinit.go