util

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 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 Collection

type Collection struct {
	Permissions access.Permissions
	Rows        Rows
}

Collection is a permissions object and Rows. If Permissions is empty, then "..." will be used.

type Collections

type Collections map[string]Collection

Collections is a map from collection names to Collections.

type Database

type Database struct {
	Permissions access.Permissions
	Collections Collections
}

Database is a permissions object and Collections. If Permissions if empty, then "..." will be used.

type Databases

type Databases map[string]Database

Databases is a map from database names to Databases.

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

	// If the Row represents a Collection or Database, then Key and Value will
	// be "" and nil respectively.
	Key   string
	Value *vdl.Value

	// If the Row represents a real Row, then Permissions will be nil,
	// otherwise it will be the Permissions of the Collection or Database.
	Permissions access.Permissions
}

Row represents a syncbase Row, Collection, or Database.

func (*Row) Equals

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

Equals returns true if the rows have the same properties.

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