skyconv

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

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 ParseInterface

func ParseInterface(i interface{}) interface{}

ParseInterface deduces whether i is a skydb data value and returns a parsed value.

FIXME(limouren): this function is public because RecordQueryHandler needs it to parse predicate's expression

func ToMap

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

ToMap converts a ToMapper to map and returns it

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) MarshalJSON

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

MarshalJSON implements json.Marshaler

func (*JSONRecord) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler

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 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 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 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