tdp

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: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

func Dial

func Dial(addr string, timeout time.Duration, blockSize uint64) (*Conn, error)

func (*Conn) Block

func (c *Conn) Block(_ context.Context, ref torus.BlockRef) ([]byte, error)

func (*Conn) BlockSize

func (c *Conn) BlockSize() uint64

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Err

func (c *Conn) Err() error

func (*Conn) PutBlock

func (c *Conn) PutBlock(ctx context.Context, ref torus.BlockRef, data []byte) error

func (*Conn) RebalanceCheck

func (c *Conn) RebalanceCheck(_ context.Context, refs []torus.BlockRef) ([]bool, error)

func (*Conn) WriteBuf

func (c *Conn) WriteBuf(_ context.Context, _ torus.BlockRef) ([]byte, error)

type Handler

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

type Server

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

func Serve

func Serve(addr string, handler Handler, blocksize uint64) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAddr

func (s *Server) ListenAddr() net.Addr

Jump to

Keyboard shortcuts

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