rpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeRead = iota
	TypeWrite
	TypeResponse
	TypeError
	TypeEOF
)

Variables

View Source
var (
	//ErrRWTimeout r/w operation timeout
	ErrRWTimeout = errors.New("r/w timeout")
)

Functions

This section is empty.

Types

type Client

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

Client replica client

func NewClient

func NewClient(conn net.Conn) *Client

NewClient replica client

func (*Client) Close

func (c *Client) Close()

Close replica client

func (*Client) ReadAt

func (c *Client) ReadAt(buf []byte, offset int64) (int, error)

ReadAt replica client

func (*Client) SetError

func (c *Client) SetError(err error)

SetError replica client transport error

func (*Client) TargetID added in v0.2.0

func (c *Client) TargetID() string

TargetID operation target ID

func (*Client) WriteAt

func (c *Client) WriteAt(buf []byte, offset int64) (int, error)

WriteAt replica client

type Message

type Message struct {
	Complete chan struct{}

	Seq    uint32
	Type   uint32
	Offset int64
	Data   []byte

	ID journal.OpID //Seq and ID can apparently be collapsed into one (ID)
	// contains filtered or unexported fields
}

type Server

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

func NewServer

func NewServer(conn net.Conn, data types.ReaderWriterAt) *Server

func (*Server) Handle

func (s *Server) Handle() error

type Wire

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

func NewWire

func NewWire(conn net.Conn) *Wire

func (*Wire) Close

func (w *Wire) Close() error

func (*Wire) Read

func (w *Wire) Read() (*Message, error)

func (*Wire) Write

func (w *Wire) Write(msg *Message) error

Jump to

Keyboard shortcuts

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