httpq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package httpq is an async queue for HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Workers           int
	DefaultMaxRetries int
	Client            *http.Client
	Errors            chan<- error
}

Config is used to configure the behaviour of the HTTP queue.

type HTTPQueue

type HTTPQueue interface {
	Enqueue(req *Request) error
	io.Closer
}

HTTPQueue sends HTTP requests.

func New

func New(file string, pass []byte, cfg *Config) (HTTPQueue, error)

New constructs a SQLite3-backed async HTTP queue. When a nil config is given, reasonable defaults will be used. If pass is non-nil, requests stored in the queue are encrypted with the password (see github.com/esote/enc for details).

type Request

type Request struct {
	Body   []byte
	Method string
	URL    *url.URL
}

Request represents a future HTTP request sent by the queue.

Jump to

Keyboard shortcuts

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