ray

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIOTimeout = errors.New("IO Timeout")
)

Functions

This section is empty.

Types

type InboundRay

type InboundRay interface {
	// InboundInput provides a stream to retrieve the request from client.
	// The inbound connection shall close the channel after the entire request
	// is received and put into the channel.
	InboundInput() OutputStream

	// InboudBound provides a stream of data for the inbound connection to write
	// as response. The inbound connection shall write all the data from the
	// channel until it is closed.
	InboundOutput() InputStream
}

InboundRay is a transport interface for inbound connections.

type InputStream

type InputStream interface {
	v2io.Reader
	Close()
}

type OutboundRay

type OutboundRay interface {
	// OutboundInput provides a stream for the input of the outbound connection.
	// The outbound connection shall write all the input until it is closed.
	OutboundInput() InputStream

	// OutboundOutput provides a stream to retrieve the response from the
	// outbound connection. The outbound connection shall close the channel
	// after all responses are receivced and put into the channel.
	OutboundOutput() OutputStream
}

OutboundRay is a transport interface for outbound connections.

type OutputStream

type OutputStream interface {
	v2io.Writer
	Close()
}

type Ray

type Ray interface {
	InboundRay
	OutboundRay
}

Ray is an internal tranport channel between inbound and outbound connection.

func NewRay

func NewRay() Ray

NewRay creates a new Ray for direct traffic transport.

type Stream

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

func NewStream

func NewStream() *Stream

func (*Stream) Close

func (this *Stream) Close()

func (*Stream) Read

func (this *Stream) Read() (*alloc.Buffer, error)

func (*Stream) Release

func (this *Stream) Release()

func (*Stream) TryWriteOnce

func (this *Stream) TryWriteOnce(data *alloc.Buffer) error

func (*Stream) Write

func (this *Stream) Write(data *alloc.Buffer) error

Jump to

Keyboard shortcuts

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