val

package
v0.0.0-...-309cb8d Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: AGPL-3.0 Imports: 7 Imported by: 12

Documentation

Overview

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Index

Constants

Variables

View Source
var Null = null{}

Functions

func Hash

func Hash(v Value, h hash.Hash64) hash.Hash64

Types

type Bool

type Bool bool

func (Bool) Copy

func (x Bool) Copy() Value

func (Bool) Equals

func (b Bool) Equals(v Value) bool

func (Bool) Primitive

func (v Bool) Primitive() bool

func (Bool) Transform

func (v Bool) Transform(f func(Value) Value) Value

func (Bool) Type

func (Bool) Type() Type

type DateTime

type DateTime struct {
	time.Time
}

func (DateTime) Copy

func (x DateTime) Copy() Value

func (DateTime) Equals

func (s DateTime) Equals(v Value) bool

func (DateTime) Primitive

func (v DateTime) Primitive() bool

func (DateTime) Transform

func (v DateTime) Transform(f func(Value) Value) Value

func (DateTime) Type

func (DateTime) Type() Type

type Float

type Float float64

func (Float) Copy

func (x Float) Copy() Value

func (Float) Equals

func (f Float) Equals(v Value) bool

func (Float) Primitive

func (v Float) Primitive() bool

func (Float) Transform

func (v Float) Transform(f func(Value) Value) Value

func (Float) Type

func (Float) Type() Type

type Int16

type Int16 int16

func (Int16) Copy

func (x Int16) Copy() Value

func (Int16) Equals

func (i Int16) Equals(v Value) bool

func (Int16) Primitive

func (Int16) Primitive() bool

func (Int16) Transform

func (v Int16) Transform(f func(Value) Value) Value

func (Int16) Type

func (Int16) Type() Type

type Int32

type Int32 int32

func (Int32) Copy

func (x Int32) Copy() Value

func (Int32) Equals

func (i Int32) Equals(v Value) bool

func (Int32) Primitive

func (Int32) Primitive() bool

func (Int32) Transform

func (v Int32) Transform(f func(Value) Value) Value

func (Int32) Type

func (Int32) Type() Type

type Int64

type Int64 int64

func (Int64) Copy

func (x Int64) Copy() Value

func (Int64) Equals

func (i Int64) Equals(v Value) bool

func (Int64) Primitive

func (Int64) Primitive() bool

func (Int64) Transform

func (v Int64) Transform(f func(Value) Value) Value

func (Int64) Type

func (Int64) Type() Type

type Int8

type Int8 int8

func (Int8) Copy

func (x Int8) Copy() Value

func (Int8) Equals

func (i Int8) Equals(v Value) bool

func (Int8) Primitive

func (Int8) Primitive() bool

func (Int8) Transform

func (v Int8) Transform(f func(Value) Value) Value

func (Int8) Type

func (Int8) Type() Type

type List

type List []Value

func (List) Copy

func (v List) Copy() Value

func (List) Equals

func (l List) Equals(v Value) bool

func (List) Map

func (l List) Map(f func(int, Value) Value) List

func (List) OverMap

func (l List) OverMap(f func(int, Value) Value) List

Like Map, but overwrites list elements in-place

func (List) Primitive

func (v List) Primitive() bool

func (List) Transform

func (v List) Transform(f func(Value) Value) Value

func (List) Type

func (List) Type() Type

type Map

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

func MapFromMap

func MapFromMap(m map[string]Value) Map

func MapFromStruct

func MapFromStruct(s Struct) Map

func NewMap

func NewMap(capacity int) Map

func (Map) Copy

func (v Map) Copy() Value

func (Map) Delete

func (v Map) Delete(k string)

func (Map) Equals

func (v Map) Equals(w Value) bool

func (Map) ForEach

func (v Map) ForEach(f func(string, Value) bool)

func (Map) Get

func (v Map) Get(k string) (Value, bool)

func (Map) Key

func (v Map) Key(k string) Value

func (Map) Keys

func (v Map) Keys() []string

func (Map) Len

func (v Map) Len() int

func (Map) Map

func (v Map) Map(f func(string, Value) Value) Map

func (Map) OverMap

func (v Map) OverMap(f func(string, Value) Value)

func (Map) Primitive

func (v Map) Primitive() bool

func (Map) Set

func (v Map) Set(k string, w Value)

func (Map) Transform

func (v Map) Transform(f func(Value) Value) Value

func (Map) Type

func (Map) Type() Type

type Meta

type Meta struct {
	Id      Ref
	Model   Ref
	Created DateTime
	Updated DateTime
	Value   Value
}

Meta is a Value that describes the attributes associated with a persisted Value. Encoders should never write it as-is. Only its Value field should be encoded.

func (Meta) Copy

func (m Meta) Copy() Value

func (Meta) Equals

func (m Meta) Equals(v Value) bool

func (Meta) Primitive

func (v Meta) Primitive() bool

func (Meta) Transform

func (v Meta) Transform(f func(Value) Value) Value

Meta.Transform does NOT call f on itself because after a transformation, the object is not the same as persisted.

func (Meta) Type

func (m Meta) Type() Type

type Ref

type Ref [2]string // [0] is model, [1] is id

func (Ref) Copy

func (x Ref) Copy() Value

func (Ref) Equals

func (s Ref) Equals(v Value) bool

func (Ref) Primitive

func (v Ref) Primitive() bool

func (Ref) Transform

func (v Ref) Transform(f func(Value) Value) Value

func (Ref) Type

func (Ref) Type() Type

type Set

type Set map[uint64]Value // hash -> value

func (Set) Copy

func (x Set) Copy() Value

func (Set) Equals

func (s Set) Equals(v Value) bool

func (Set) Keys

func (s Set) Keys() []uint64

func (Set) Primitive

func (v Set) Primitive() bool

func (Set) Transform

func (x Set) Transform(f func(Value) Value) Value

func (Set) Type

func (Set) Type() Type

type String

type String string

func (String) Copy

func (x String) Copy() Value

func (String) Equals

func (s String) Equals(v Value) bool

func (String) Primitive

func (v String) Primitive() bool

func (String) String

func (s String) String() string

func (String) Transform

func (v String) Transform(f func(Value) Value) Value

func (String) Type

func (String) Type() Type

type Struct

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

func NewStruct

func NewStruct(capacity int) Struct

func StructFromMap

func StructFromMap(m map[string]Value) Struct

func (Struct) Copy

func (v Struct) Copy() Value

func (Struct) Delete

func (v Struct) Delete(k string)

func (Struct) Equals

func (v Struct) Equals(w Value) bool

func (Struct) Field

func (v Struct) Field(k string) Value

func (Struct) ForEach

func (v Struct) ForEach(f func(string, Value) bool)

func (Struct) Get

func (v Struct) Get(k string) (Value, bool)

func (Struct) Keys

func (v Struct) Keys() []string

func (Struct) Len

func (v Struct) Len() int

func (Struct) Map

func (v Struct) Map(f func(string, Value) Value) Struct

func (Struct) OverMap

func (v Struct) OverMap(f func(string, Value) Value)

func (Struct) Primitive

func (v Struct) Primitive() bool

func (Struct) Set

func (v Struct) Set(k string, w Value)

func (Struct) Transform

func (v Struct) Transform(f func(Value) Value) Value

func (Struct) Type

func (Struct) Type() Type

type Symbol

type Symbol string

func (Symbol) Copy

func (x Symbol) Copy() Value

func (Symbol) Equals

func (s Symbol) Equals(v Value) bool

func (Symbol) Primitive

func (v Symbol) Primitive() bool

func (Symbol) Transform

func (v Symbol) Transform(f func(Value) Value) Value

func (Symbol) Type

func (Symbol) Type() Type

type Tuple

type Tuple []Value

func (Tuple) Copy

func (v Tuple) Copy() Value

func (Tuple) Equals

func (l Tuple) Equals(v Value) bool

func (Tuple) OverMap

func (l Tuple) OverMap(f func(int, Value) Value) Tuple

func (Tuple) Primitive

func (v Tuple) Primitive() bool

func (Tuple) Transform

func (v Tuple) Transform(f func(Value) Value) Value

func (Tuple) Type

func (Tuple) Type() Type

type Type

type Type uint64
const (
	TypeTuple Type = 1 << iota
	TypeList
	TypeUnion
	TypeStruct
	TypeMap
	TypeFloat
	TypeBool
	TypeString
	TypeRef
	TypeDateTime
	TypeNull
	TypeSymbol
	TypeSet
	TypeInt8
	TypeInt16
	TypeInt32
	TypeInt64
	TypeUint8
	TypeUint16
	TypeUint32
	TypeUint64
)

func (Type) String

func (t Type) String() string

type Uint16

type Uint16 uint16

func (Uint16) Copy

func (x Uint16) Copy() Value

func (Uint16) Equals

func (i Uint16) Equals(v Value) bool

func (Uint16) Primitive

func (Uint16) Primitive() bool

func (Uint16) Transform

func (v Uint16) Transform(f func(Value) Value) Value

func (Uint16) Type

func (Uint16) Type() Type

type Uint32

type Uint32 uint32

func (Uint32) Copy

func (x Uint32) Copy() Value

func (Uint32) Equals

func (i Uint32) Equals(v Value) bool

func (Uint32) Primitive

func (Uint32) Primitive() bool

func (Uint32) Transform

func (v Uint32) Transform(f func(Value) Value) Value

func (Uint32) Type

func (Uint32) Type() Type

type Uint64

type Uint64 uint64

func (Uint64) Copy

func (x Uint64) Copy() Value

func (Uint64) Equals

func (i Uint64) Equals(v Value) bool

func (Uint64) Primitive

func (Uint64) Primitive() bool

func (Uint64) Transform

func (v Uint64) Transform(f func(Value) Value) Value

func (Uint64) Type

func (Uint64) Type() Type

type Uint8

type Uint8 uint8

func (Uint8) Copy

func (x Uint8) Copy() Value

func (Uint8) Equals

func (i Uint8) Equals(v Value) bool

func (Uint8) Primitive

func (Uint8) Primitive() bool

func (Uint8) Transform

func (v Uint8) Transform(f func(Value) Value) Value

func (Uint8) Type

func (Uint8) Type() Type

type Union

type Union struct {
	Case  string
	Value Value
}

func (Union) Copy

func (v Union) Copy() Value

func (Union) Equals

func (u Union) Equals(v Value) bool

func (Union) Primitive

func (v Union) Primitive() bool

func (Union) Transform

func (v Union) Transform(f func(Value) Value) Value

func (Union) Type

func (Union) Type() Type

type Value

type Value interface {
	Copy() Value
	Equals(Value) bool
	Transform(func(Value) Value) Value
	Primitive() bool
	Type() Type
}

func TransformIdentity

func TransformIdentity(v Value) Value

Jump to

Keyboard shortcuts

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