Documentation ¶
Index ¶
- Constants
- Variables
- func Dispatcher() *gorpc.Dispatcher
- func RegisterSessionMaker(id MessageID, f NewSessionHandlerFunc)
- func Shutdown()
- func StartServer(address string) error
- func StopServer(address string) error
- type Caller
- type MessageHandler
- type MessageID
- type NewSessionHandlerFunc
- type Session
- type SessionHandler
- type SessionID
- type Transmit
Constants ¶
const (
// The default address for internal messaging to this DVID server
DefaultAddress = "localhost:8002"
)
Variables ¶
Functions ¶
func Dispatcher ¶
func Dispatcher() *gorpc.Dispatcher
func RegisterSessionMaker ¶
func RegisterSessionMaker(id MessageID, f NewSessionHandlerFunc)
RegisterSessionMaker allows any package to register a function to create a new session handler given a designated message type.
Types ¶
type MessageHandler ¶
type MessageHandler func(interface{}) (interface{}, error)
type MessageID ¶
type MessageID string
MessageID should be a unique string across the DVID code base. By convention, the package name should be prefixed to the type of session being performed, e.g., "datastore.Push"
type NewSessionHandlerFunc ¶
type NewSessionHandlerFunc func(MessageID) (SessionHandler, error)
NewSessionHandlerFunc is a function that creates new session handlers
type Session ¶
Session provides ability to send data to remote DVID using multiple RPCs.
func NewSession ¶
NewSession returns a new session to the remote address where the type of session is reflected by the MessageID.
type SessionHandler ¶
SessionHandler has a state, processes incoming messages via a finite state machine, and knows how to terminate itself upon receiving a termination message, calling the rpc package EndSession.
func GetSessionHandler ¶
func GetSessionHandler(sid SessionID) (SessionHandler, error)