v0.3.2 Latest Latest

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 9 Imported by: 8




This section is empty.


This section is empty.


This section is empty.


type API added in v0.3.0

type API struct {
	// contains filtered or unexported fields

HTTP API for managing a mail queue.

func New added in v0.3.0

func New(config *Config, queue *queue.Queue) *API

Create a new API instance for the specified queue.

func (*API) ServeHTTP added in v0.3.0

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

Process an incoming request. This method logs the request and checks to ensure that HTTP basic auth credentials were supplied if required.

func (*API) Start added in v0.3.0

func (a *API) Start() error

Start listening for new requests.

func (*API) Stop added in v0.3.0

func (a *API) Stop()

Stop listening for new requests.

type Config added in v0.3.0

type Config struct {
	Addr       string `json:"bind"`
	CORSOrigin string `json:"cors-origin"`
	TLSCert    string `json:"tls-cert"`
	TLSKey     string `json:"tls-key"`
	Username   string `json:"username"`
	Password   string `json:"password"`

Configuration for the HTTP API.

Jump to

Keyboard shortcuts

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