server

package
v0.0.0-...-2551dc1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2013 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package server provides web and rpc interfaces to DVID operations. For web browser access, the goal is to provide a GUI for monitoring and performing a subset of operations in a nicely formatted view.

DVID command line interaction occurs via the rpc interface to a running server. Please see the main DVID documentation:

http://godoc.org/github.com/janelia-flyem/dvid

Examples of planned browser-based features in order of likely implementation:

  • Peruse documentation on DVID operation and APIs (HTTP and eventually Thrift).

  • Graphically show the image version DAG and allow the viewer to examine the provenance along the edges. (GUI for 'log' command.)

  • View slices of an image version via a javascript (or Dart) program. This could be extended to allow interactive editing and n-dimensional visualization.

  • Query remote DVID servers regarding the state of their volume.

Index

Constants

View Source
const (
	// The default URL of the DVID web server
	DefaultWebAddress = "localhost:8000"

	// The default RPC address of the DVID RPC server
	DefaultRPCAddress = "localhost:8001"

	// The relative URL path to our Level 2 REST API
	WebAPIPath = "/api/"

	// The name of the server error log, stored in the datastore directory.
	ErrorLogFilename = "dvid-errors.log"
)

Variables

View Source
var (

	// Timeout in seconds for waiting to open a datastore for exclusive access.
	TimeoutSecs int = 0

	// GzipAPI turns on gzip compression on REST API responses.
	// For high bandwidth networks or local use, it is better to leave gzip
	// off because delay due to compression is frequently higher than gains
	// from decreased response size.
	GzipAPI = false
)

Functions

func ServerlessDo

func ServerlessDo(datastoreDir string, request datastore.Request, reply *datastore.Response) error

ServerlessDo runs a command locally, opening and closing a datastore as necessary.

func Shutdown

func Shutdown()

Shutdown handles graceful cleanup of server functions before exiting DVID.

Types

type RPCConnection

type RPCConnection struct{}

RPCConnection will export all of its functions for rpc access.

func (*RPCConnection) Do

Do acts as a switchboard for remote command execution

type Service

type Service struct {
	// The currently opened DVID datastore
	*datastore.Service

	// Error log directory
	ErrorLogDir string

	// The address of the web server
	WebAddress string

	// The path to the DVID web client
	WebClientPath string

	// The address of the rpc server
	RPCAddress string
}

Service holds information on the servers attached to a DVID datastore.

func DataService

func DataService() *Service

DataService returns the current datastore service. One DVID process is assigned to one datastore service, although it may be possible to have multiple (polyglot) persistence backends attached to that one service.

func OpenDatastore

func OpenDatastore(datastoreDir string) (service *Service, err error)

OpenDatastore returns a Server service. Only one datastore can be opened for any server.

func (*Service) Serve

func (service *Service) Serve(webAddress, webClientDir, rpcAddress string) error

Serve opens a datastore then creates both web and rpc servers for the datastore. This function must be called for DataService() to be non-nil.

func (*Service) ServeHttp

func (service *Service) ServeHttp(address, clientDir string)

Listen and serve HTTP requests using address and don't let stay-alive connections hog goroutines for more than an hour. See for discussion: http://stackoverflow.com/questions/10971800/golang-http-server-leaving-open-goroutines

func (*Service) ServeRpc

func (service *Service) ServeRpc(address string) error

Listen and serve RPC requests using address.

type Subvolume

type Subvolume struct {
	Dataset          *string `protobuf:"bytes,1,req,name=dataset" json:"dataset,omitempty"`
	OffsetX          *int32  `protobuf:"varint,2,req,name=offsetX" json:"offsetX,omitempty"`
	OffsetY          *int32  `protobuf:"varint,3,req,name=offsetY" json:"offsetY,omitempty"`
	OffsetZ          *int32  `protobuf:"varint,4,req,name=offsetZ" json:"offsetZ,omitempty"`
	SizeX            *uint32 `protobuf:"varint,5,req,name=sizeX" json:"sizeX,omitempty"`
	SizeY            *uint32 `protobuf:"varint,6,req,name=sizeY" json:"sizeY,omitempty"`
	SizeZ            *uint32 `protobuf:"varint,7,req,name=sizeZ" json:"sizeZ,omitempty"`
	Data             []byte  `protobuf:"bytes,8,opt,name=data" json:"data,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*Subvolume) GetData

func (m *Subvolume) GetData() []byte

func (*Subvolume) GetDataset

func (m *Subvolume) GetDataset() string

func (*Subvolume) GetOffsetX

func (m *Subvolume) GetOffsetX() int32

func (*Subvolume) GetOffsetY

func (m *Subvolume) GetOffsetY() int32

func (*Subvolume) GetOffsetZ

func (m *Subvolume) GetOffsetZ() int32

func (*Subvolume) GetSizeX

func (m *Subvolume) GetSizeX() uint32

func (*Subvolume) GetSizeY

func (m *Subvolume) GetSizeY() uint32

func (*Subvolume) GetSizeZ

func (m *Subvolume) GetSizeZ() uint32

func (*Subvolume) ProtoMessage

func (*Subvolume) ProtoMessage()

func (*Subvolume) Reset

func (m *Subvolume) Reset()

func (*Subvolume) String

func (m *Subvolume) String() string

type Terminal

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

Terminal provides a stateful client for DVID interaction. Unlike using DVID commands from the shell, terminal use keeps several DVID values (e.g., rpc address, image version UUID) in memory and provides them automatically to the DVID server.

func NewTerminal

func NewTerminal(datastoreDir, rpcAddress string) *Terminal

NewTerminal returns a terminal with an RPC connection to the given rpcAddress.

func (*Terminal) Send

func (terminal *Terminal) Send(cmd dvid.Command) (err error)

Send transmits an RPC command if a server is available or else it runs the command in serverless mode.

func (*Terminal) Shell

func (terminal *Terminal) Shell()

Shell takes commands and processes them in an endless loop.

Jump to

Keyboard shortcuts

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