http

package module
v0.0.0-...-8bbe2a5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: Apache-2.0 Imports: 7 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

http

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHTTPReceiverAlreadyStarted = errors.New("http receiver already started")
)
View Source
var (
	ErrHTTPSenderAlreadyStarted = errors.New("http sender already started")
)

Functions

func NewHTTPSender

func NewHTTPSender(name string, options spirit.Map) (sender spirit.Sender, err error)

Types

type HTTPReceiver

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

func NewHTTPReceiver

func NewHTTPReceiver(conf HTTPReceiverConfig, requestHandler HTTPRequestHandlerFunc) (receiver *HTTPReceiver, err error)

func (*HTTPReceiver) Group

func (p *HTTPReceiver) Group(path string, router func(martini.Router), middlerWares ...martini.Handler)

func (*HTTPReceiver) Handler

func (p *HTTPReceiver) Handler(res gohttp.ResponseWriter, req *gohttp.Request)

func (*HTTPReceiver) SetDeliveryPutter

func (p *HTTPReceiver) SetDeliveryPutter(putter spirit.DeliveryPutter) (err error)

func (*HTTPReceiver) Start

func (p *HTTPReceiver) Start() (err error)

func (*HTTPReceiver) Status

func (p *HTTPReceiver) Status() spirit.Status

func (*HTTPReceiver) Stop

func (p *HTTPReceiver) Stop() (err error)

type HTTPReceiverConfig

type HTTPReceiverConfig struct {
	Address       string `json:"address"`
	DisableLogger bool   `json:"disable_logger"`
}

type HTTPRequestHandlerFunc

type HTTPRequestHandlerFunc func(
	res http.ResponseWriter,
	req *http.Request,
	deliveryChan <-chan spirit.Delivery,
	done chan<- bool,
) (deliveries []spirit.Delivery, err error)

type HTTPSender

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

func (*HTTPSender) Name

func (p *HTTPSender) Name() string

func (*HTTPSender) SetDeliveryGetter

func (p *HTTPSender) SetDeliveryGetter(getter spirit.DeliveryGetter) (err error)

func (*HTTPSender) Start

func (p *HTTPSender) Start() (err error)

func (*HTTPSender) Status

func (p *HTTPSender) Status() spirit.Status

func (*HTTPSender) Stop

func (p *HTTPSender) Stop() (err error)

func (*HTTPSender) URN

func (p *HTTPSender) URN() string

type HTTPSenderConfig

type HTTPSenderConfig struct {
	Timeout int `json:"timeout"`
}

Jump to

Keyboard shortcuts

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