skyconv

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 7 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapFrom

func MapFrom(i interface{}, fromMapper FromMapper) error

MapFrom tries to map a map to a FromMapper

func ParseLiteral

func ParseLiteral(i interface{}) interface{}

ParseLiteral deduces whether i is a skydb data value and returns a parsed value. nolint: gocyclo

func ToLiteral added in v1.6.0

func ToLiteral(i interface{}) interface{}

ToLiteral converts a primitive type or a skydb type into a map. This is the opposite of ParseLiteral. nolint: gocyclo

func ToMap

func ToMap(mapper ToMapper) map[string]interface{}

ToMap converts a ToMapper to map and returns it

func TryParseLiteral added in v1.6.0

func TryParseLiteral(i interface{}) (out interface{}, err error)

TryParseLiteral deduces whether i is a skydb data value and returns a parsed value. nolint: gocyclo

Types

type FromMapper

type FromMapper interface {
	FromMap(m map[string]interface{}) error
}

FromMapper defines whether a type can be converted from a map

type JSONRecord

type JSONRecord skydb.Record

JSONRecord defines a common serialization format for skydb.Record

func (*JSONRecord) FromMap

func (record *JSONRecord) FromMap(m map[string]interface{}) error

func (*JSONRecord) MarshalJSON

func (record *JSONRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler nolint: gocyclo

func (*JSONRecord) ToMap added in v1.6.0

func (record *JSONRecord) ToMap(m map[string]interface{})

func (*JSONRecord) UnmarshalJSON

func (record *JSONRecord) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

type MapACLEntry

type MapACLEntry skydb.RecordACLEntry

func (*MapACLEntry) FromMap

func (ace *MapACLEntry) FromMap(m map[string]interface{}) error

FromMap initializes a RecordACLEntry from a unmarshalled JSON of access control definition

type MapAsset

type MapAsset skydb.Asset

MapAsset is skydb.Asset that can be converted from and to a map.

func (*MapAsset) FromMap

func (asset *MapAsset) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (*MapAsset) ToMap

func (asset *MapAsset) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapData

type MapData map[string]interface{}

MapData is record data that can be converted from a map

func (*MapData) FromMap

func (data *MapData) FromMap(m map[string]interface{}) (err error)

FromMap implements FromMapper

func (MapData) ToMap

func (data MapData) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapFieldACLEntry added in v1.1.0

type MapFieldACLEntry skydb.FieldACLEntry

func (*MapFieldACLEntry) FromMap added in v1.1.0

func (ace *MapFieldACLEntry) FromMap(m map[string]interface{}) error

FromMap initializes a FieldACLEntry from a unmarshalled JSON of field access control definition

type MapGeometry added in v0.23.0

type MapGeometry skydb.Geometry

MapGeometry is skydb.Geometry that can be converted from and to a map.

func (*MapGeometry) FromMap added in v0.23.0

func (geom *MapGeometry) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapGeometry) ToMap added in v0.23.0

func (geom MapGeometry) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapKeyPath

type MapKeyPath string

MapKeyPath is string keypath that can be converted from a map

func (*MapKeyPath) FromMap

func (p *MapKeyPath) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapKeyPath) ToMap

func (p MapKeyPath) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapLocation

type MapLocation skydb.Location

MapLocation is skydb.Location that can be converted from and to a map.

func (*MapLocation) FromMap

func (loc *MapLocation) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapLocation) ToMap

func (loc MapLocation) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapReference

type MapReference skydb.Reference

MapReference is skydb.Reference that can be converted from and to a map.

func (*MapReference) FromMap

func (ref *MapReference) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapReference) ToMap

func (ref MapReference) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapRelation

type MapRelation struct {
	Name      string
	Direction string
}

MapRelation is a type specifying a relation between two users, but do not conform to any actual struct in skydb.

func (*MapRelation) FromMap

func (rel *MapRelation) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (*MapRelation) ToMap

func (rel *MapRelation) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapSequence

type MapSequence struct{}

MapSequence is skydb.Sequence that can convert to map

func (MapSequence) ToMap

func (seq MapSequence) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapTime

type MapTime time.Time

MapTime is time.Time that can be converted from and to a map.

func (*MapTime) FromMap

func (t *MapTime) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapTime) ToMap

func (t MapTime) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapUnknown added in v0.20.0

type MapUnknown skydb.Unknown

MapUnknown is skydb.Unknown that can convert to map

func (*MapUnknown) FromMap added in v0.20.0

func (val *MapUnknown) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (MapUnknown) ToMap added in v0.20.0

func (val MapUnknown) ToMap(m map[string]interface{})

ToMap implements ToMapper

type MapWrappedRecord added in v1.6.0

type MapWrappedRecord skydb.Record

MapWrappedRecord is skydb.Record that can be converted from and to a map.

func (*MapWrappedRecord) FromMap added in v1.6.0

func (t *MapWrappedRecord) FromMap(m map[string]interface{}) error

FromMap implements FromMapper

func (*MapWrappedRecord) ToMap added in v1.6.0

func (t *MapWrappedRecord) ToMap(m map[string]interface{})

ToMap implements ToMapper

type ToMapper

type ToMapper interface {
	ToMap(m map[string]interface{})
}

ToMapper defines whether a type can be converted to a map

Jump to

Keyboard shortcuts

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