protocol

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadFormat errResponse = []byte(`BAD_FORMAT\r\n`)

ErrBadFormat - The client sent a command line that was not well-formed.

This can happen if the line does not end with \r\n, if non-numeric
characters occur where an integer is expected, if the wrong number of
arguments are present, or if the command line is mal-formed in any other
way.
View Source
var ErrInternal errResponse = []byte(`INTERNAL_ERROR\r\n`)

ErrInternal - This indicates a bug in the server. It should never happen.

View Source
var ErrJobNotFound = errors.New("job not found")

ErrJobNotFound is thrown when doing an operation against an unknown job

View Source
var ErrOutOfMem errResponse = []byte(`OUT_OF_MEMORY\r\n`)

ErrOutOfMem - The server cannot allocate enough memory for the job.

The client should try again later.
View Source
var ErrTubeNotFound = errors.New("tube not found")

ErrTubeNotFound is thrown when doing an operation against an unknown tube

View Source
var ErrUnknownCmd errResponse = []byte(`UNKNOWN_COMMAND\r\n`)

ErrUnknownCmd - The client sent a command that the server does not know.

Functions

This section is empty.

Types

type BeanstalkdSrv

type BeanstalkdSrv interface {
	// contains filtered or unexported methods
}

BeanstalkdSrv implements the beanstalkd server responsibilities

func NewSrvStub

func NewSrvStub() BeanstalkdSrv

NewSrvStub returns a stub BeanstalkdSrv

func NewSrvYaad

func NewSrvYaad() BeanstalkdSrv

NewSrvYaad returns a yaad BeanstalkdSrv

type Connection

type Connection struct {
	*textproto.Conn
	// contains filtered or unexported fields
}

Connection implements a yaad + beanstalkd protocol server

type Job

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

Job represents a beanstalkd job

type Server

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

Server is a yaad server

func NewYaadServer

func NewYaadServer() *Server

NewYaadServer returns a pointer to a new yaad server

func (*Server) Close

func (s *Server) Close() error

Close the listener

func (*Server) Listen

func (s *Server) Listen(protocol, address string) error

Listen to connections

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(protocol, address string) error

ListenAndServe starts listening for new connections (blocking)

type SrvStub

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

SrvStub implements a stub beanstalkd instance

type SrvYaad

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

SrvYaad implements a yaad beanstalkd instance

type Tube

type Tube interface {
	// contains filtered or unexported methods
}

Tube is a beanstalkd tube

type TubeStub

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

TubeStub implements a stub beanstalkd tube

type TubeYaad

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

TubeYaad implements a yaad hub as a beanstalkd tube

Jump to

Keyboard shortcuts

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