trafo

package
v0.0.0-...-98fda95 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CodecSet is a set of all registered entity codecs.
	CodecSet *structor.Set
)

Functions

This section is empty.

Types

type Doc

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

Doc is a reader and writer for a datastore entity.

It is based on: https://code.google.com/p/appengine-go/source/browse/appengine/datastore/prop.go

func (*Doc) Load

func (doc *Doc) Load(c <-chan ds.Property) error

Load loads the entity from datastore properties.

func (*Doc) Nil

func (doc *Doc) Nil()

Nil sets the value of the entity to nil.

func (*Doc) Pipe

func (doc *Doc) Pipe(ctx ae.Context) ds.PropertyLoadSaver

Pipe returns a PropertyLoadSaver to load/save an entity.

func (*Doc) Save

func (doc *Doc) Save(ctx ae.Context) (props []*ds.Property, err error)

Save saves the entity to datastore properties.

type DocList

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

DocList represents a collection of Doc.

func NewReadableDocList

func NewReadableDocList(kind *types.Kind, src interface{}) (*DocList, error)

NewReadableDocList returns a new DocList, suitable for reading from it.

func NewWriteableDocList

func NewWriteableDocList(src interface{}, keys []*types.Key, multi bool) (*DocList, error)

NewWriteableDocList creates a new DocList, suitable for writing to it.

func (*DocList) Add

func (l *DocList) Add(key *types.Key, doc *Doc)

Add appends a new Doc to the list.

func (*DocList) ApplyResult

func (l *DocList) ApplyResult(dsKeys []*ds.Key, dsErr error) ([]*types.Key, error)

func (*DocList) Get

func (l *DocList) Get(nth int) (ret *Doc)

Get returns the list's nth Doc. it is created first if it doesn't already exist.

func (*DocList) Keys

func (l *DocList) Keys() []*types.Key

Keys returns the list's sequence of Key.

func (*DocList) Pipe

func (l *DocList) Pipe(ctx ae.Context) *DocsPipe

Pipe returns the a DocsPipe to load/save the entities.

type DocsPipe

type DocsPipe struct {
	Docs []*Doc
	// contains filtered or unexported fields
}

DocsPipe can load/save datastore entries from/to entities.

func (*DocsPipe) Properties

func (p *DocsPipe) Properties() []ds.PropertyLoadSaver

Properties returns a sequence of datastore.PropertyLoadSaver.

Jump to

Keyboard shortcuts

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