util

package
v0.0.0-...-ff5f600 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeedService

func SeedService(ctx *context.T, s syncbase.Service, dbs Databases) error

SeedService creates databases, collections, and rows in a syncbase service.

Types

type Collections

type Collections map[string]Rows

Collections is a map from collection names to Rows.

type Databases

type Databases map[string]Collections

Databases is a map from database names to Collections.

type DumpStream

type DumpStream struct {
	// ServiceName is the name of the syncbase service from which Rows will be
	// dumped.
	ServiceName string
	// contains filtered or unexported fields
}

DumpStream iterates through all collections in all database, and all rows in each collection, emiting Rows for each row in the collection. The stream is ordered first by database, then by collection, then by row. In addition, a Row is emitted for each database before all of its collections, and a Row is emitted for each collections before its rows.

func NewDumpStream

func NewDumpStream(ctx *context.T, service syncbase.Service) (*DumpStream, error)

func (*DumpStream) Advance

func (s *DumpStream) Advance() bool

func (*DumpStream) Cancel

func (s *DumpStream) Cancel()

func (*DumpStream) Err

func (s *DumpStream) Err() error

func (*DumpStream) Row

func (s *DumpStream) Row() *Row

Row returns the next row in the DumpStream.

type Row

type Row struct {
	DatabaseId   wire.Id
	CollectionId wire.Id
	Key          string
	Value        *vdl.Value
}

Row wraps a key, value, and collectionId.

func (*Row) Equals

func (r *Row) Equals(rr *Row) bool

Equals returns true if the rows have the same DatabaseId, CollectionId, Key, and Value.

type Rows

type Rows map[string]string

Rows is a map from keys to values.

Jump to

Keyboard shortcuts

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