memqserver

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExist = errors.New("already exists")
View Source
var ErrEmptyName = errors.New("empty name")
View Source
var ErrEmptyQueue = errors.New("empty queue")
View Source
var ErrNotExist = errors.New("does not exist")

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Queues map[string]*Queue
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker() *Broker

func (*Broker) CreateQueue

func (b *Broker) CreateQueue(name string) error

func (*Broker) DeleteQueue

func (b *Broker) DeleteQueue(name string) error

func (*Broker) DrainQueue

func (b *Broker) DrainQueue(name string) error

func (*Broker) GetMessage

func (b *Broker) GetMessage(queue string) (*memq.Message, error)

func (*Broker) PutMessage

func (b *Broker) PutMessage(queue, body string) (*memq.Message, error)

func (*Broker) Stats

func (b *Broker) Stats() *memq.Stats

type Queue

type Queue struct {
	Depth    int64
	Enqueued int64
	Dequeued int64
	Drained  int64
	Messages []*memq.Message
	// contains filtered or unexported fields
}

type Server

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

func NewServer

func NewServer(path string) *Server

func (*Server) AddRoutes

func (s *Server) AddRoutes(router *httprouter.Router)

func (*Server) CreateQueue

func (s *Server) CreateQueue(w http.ResponseWriter, r *http.Request, p httprouter.Params)

func (*Server) DeleteQueue

func (s *Server) DeleteQueue(w http.ResponseWriter, r *http.Request, p httprouter.Params)

func (*Server) Dequeue

func (s *Server) Dequeue(w http.ResponseWriter, r *http.Request, p httprouter.Params)

func (*Server) DrainQueue

func (s *Server) DrainQueue(w http.ResponseWriter, r *http.Request, p httprouter.Params)

func (*Server) Enqueue

func (s *Server) Enqueue(w http.ResponseWriter, r *http.Request, p httprouter.Params)

func (*Server) GetStats

func (s *Server) GetStats(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

Jump to

Keyboard shortcuts

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