server

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: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDispatcher

func NewDispatcher(s *service) *dispatcher

func NewService

func NewService(ctx *context.T, opts ServiceOptions) (*service, error)

NewService creates a new service instance and returns it. TODO(sadovsky): If possible, close all stores when the server is stopped.

func PermsString

func PermsString(ctx *context.T, perms access.Permissions) string

PermsString returns a JSON-based string representation of the permissions.

Types

type DatabaseData

type DatabaseData struct {
	Id             syncbase.Id
	Version        uint64 // covers the Perms field below
	Perms          access.Permissions
	SchemaMetadata *syncbase.SchemaMetadata
}

DatabaseData represents the persistent state of a Database, stored in the per-database storage engine.

func (*DatabaseData) GetPerms

func (data *DatabaseData) GetPerms() access.Permissions

func (DatabaseData) VDLIsZero

func (x DatabaseData) VDLIsZero() bool

func (*DatabaseData) VDLRead

func (x *DatabaseData) VDLRead(dec vdl.Decoder) error

func (DatabaseData) VDLReflect

func (DatabaseData) VDLReflect(struct {
	Name string `vdl:"v.io/x/ref/services/syncbase/server.DatabaseData"`
})

func (DatabaseData) VDLWrite

func (x DatabaseData) VDLWrite(enc vdl.Encoder) error

type DatabaseOptions

type DatabaseOptions struct {
	// Database-level permissions.
	Perms access.Permissions
	// Root dir for data storage. This path is relative from the service's RootDir.
	RootDir string
	// Storage engine to use.
	Engine string
}

DatabaseOptions configures a database.

type DbInfo

type DbInfo struct {
	Id syncbase.Id
	// Select fields from DatabaseOptions, needed in order to open storage engine
	// on restart.
	RootDir string // interpreted by storage engine
	Engine  string // name of storage engine, e.g. "leveldb"
}

DbInfo contains information about a single Database, stored in the service-level storage engine.

func (DbInfo) VDLIsZero

func (x DbInfo) VDLIsZero() bool

func (*DbInfo) VDLRead

func (x *DbInfo) VDLRead(dec vdl.Decoder) error

func (DbInfo) VDLReflect

func (DbInfo) VDLReflect(struct {
	Name string `vdl:"v.io/x/ref/services/syncbase/server.DbInfo"`
})

func (DbInfo) VDLWrite

func (x DbInfo) VDLWrite(enc vdl.Encoder) error

type ServiceData

type ServiceData struct {
	Version uint64 // covers the fields below
	Perms   access.Permissions
}

ServiceData represents the persistent state of a Service.

func (*ServiceData) GetPerms

func (data *ServiceData) GetPerms() access.Permissions

func (ServiceData) VDLIsZero

func (x ServiceData) VDLIsZero() bool

func (*ServiceData) VDLRead

func (x *ServiceData) VDLRead(dec vdl.Decoder) error

func (ServiceData) VDLReflect

func (ServiceData) VDLReflect(struct {
	Name string `vdl:"v.io/x/ref/services/syncbase/server.ServiceData"`
})

func (ServiceData) VDLWrite

func (x ServiceData) VDLWrite(enc vdl.Encoder) error

type ServiceOptions

type ServiceOptions struct {
	// Service-level permissions. Used only when creating a brand new storage
	// instance.
	Perms access.Permissions
	// Root dir for data storage. If empty, we write to a fresh directory created
	// using ioutil.TempDir.
	RootDir string
	// Storage engine to use: memstore or leveldb. If empty, we use the default
	// storage engine, currently leveldb.
	Engine string
	// Whether to skip publishing in the neighborhood.
	SkipPublishInNh bool
	// Whether to run in development mode; required for RPCs such as
	// Service.DevModeUpdateVClock.
	DevMode bool
	// InitialDB, if not blank, specifies an initial database to create when
	// creating a brand new storage instance.
	InitialDB wire.Id
}

ServiceOptions configures a service.

Directories

Path Synopsis
Package filter contains filter implementations for matching collections and rows within them.
Package filter contains filter implementations for matching collections and rows within them.
Package interfaces defines internal interfaces for various objects in the Syncbase server implementation.
Package interfaces defines internal interfaces for various objects in the Syncbase server implementation.

Jump to

Keyboard shortcuts

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