protocols

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2016 License: Apache-2.0 Imports: 5 Imported by: 18

Documentation

Overview

protocols is the metapackage for the RPC protocols for how Torus' storage layer communicates with other storage servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRPCDialer

func RegisterRPCDialer(scheme string, newFunc RPCDialerFunc)

func RegisterRPCListener

func RegisterRPCListener(scheme string, newFunc RPCListenerFunc)

Types

type RPC

type RPC interface {
	PutBlock(ctx context.Context, ref torus.BlockRef, data []byte) error
	Block(ctx context.Context, ref torus.BlockRef) ([]byte, error)
	RebalanceCheck(ctx context.Context, refs []torus.BlockRef) ([]bool, error)
	Close() error

	// This is a little bit of a hack to avoid more allocations.
	WriteBuf(ctx context.Context, ref torus.BlockRef) ([]byte, error)
}

func DialRPC

func DialRPC(url *url.URL, timeout time.Duration, gmd torus.GlobalMetadata) (RPC, error)

type RPCDialerFunc

type RPCDialerFunc func(*url.URL, time.Duration, torus.GlobalMetadata) (RPC, error)

type RPCListenerFunc

type RPCListenerFunc func(*url.URL, RPC, torus.GlobalMetadata) (RPCServer, error)

type RPCServer

type RPCServer interface {
	Close() error
}

func ListenRPC

func ListenRPC(url *url.URL, handler RPC, gmd torus.GlobalMetadata) (RPCServer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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