pandora

package
v0.0.0-...-cf82ea8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Overview

pandora is a reference client for the pandora server

This client uses a http client to access the message store

Index

Constants

View Source
const (
	// Confirm that the message was processed and remove it from the mailbox
	Confirm = AckStatus(pandora.StatusConfirmed)
	// Unable to process the message, put it back on the mailbox
	Reject = AckStatus(pandora.StatusRejected)
)

Variables

View Source
var (
	ErrNoData = errors.New("no data available")
)

Functions

This section is empty.

Types

type AckStatus

type AckStatus byte

AckStatus represent the status of the processing of the message

type HttpClient

type HttpClient interface {
	// PostForm is used to send the given body values to the url
	PostForm(url string, body url.Values) (*http.Response, error)
}

HttpClient defines the interface required to enable a Mailbox object to talk with a Pandora server

type Mailbox

type Mailbox struct {
	BaseUrl string
	Client  HttpClient
}

Mailbox is the most basic form o interaction with a pandora server.

func (*Mailbox) Ack

func (mb *Mailbox) Ack(mid, lid string, status AckStatus) error

Ack marks the message as processed or rejected

func (*Mailbox) Fetch

func (mb *Mailbox) Fetch(from string, lockFor time.Duration) (url.Values, error)

Fetch asks for the server for a message

func (*Mailbox) Send

func (mb *Mailbox) Send(from, to string, delay time.Duration, body url.Values) (string, error)

Send will update the given body with the paramters expected by a Pandora server and return the Mid generated by the server or an error.

Jump to

Keyboard shortcuts

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