httphandler

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package httphandler implements a HTTP handler

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHeaderName = errors.New("Invalid header name")
)

errors

Functions

This section is empty.

Types

type Handler

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

Handler implements a HTTP handler for sending and notifying a HTTP endpoint.

func NewHandler

func NewHandler(conf HandlerConfig) (*Handler, error)

NewHandler creates a new HTTPHandler.

func (*Handler) Close

func (h *Handler) Close() error

Close closes the handler.

func (*Handler) SendACKNotification

func (h *Handler) SendACKNotification(pl handler.ACKNotification) error

SendACKNotification sends an ACK notification.

func (*Handler) SendDataUp

func (h *Handler) SendDataUp(pl handler.DataUpPayload) error

SendDataUp sends a data-up payload.

func (*Handler) SendErrorNotification

func (h *Handler) SendErrorNotification(pl handler.ErrorNotification) error

SendErrorNotification sends an error notification.

func (*Handler) SendJoinNotification

func (h *Handler) SendJoinNotification(pl handler.JoinNotification) error

SendJoinNotification sends a join notification.

func (*Handler) SendStatusNotification

func (h *Handler) SendStatusNotification(pl handler.StatusNotification) error

SendStatusNotification sends a status notification.

type HandlerConfig

type HandlerConfig struct {
	Headers               map[string]string `json:"headers"`
	DataUpURL             string            `json:"dataUpURL"`
	JoinNotificationURL   string            `json:"joinNotificationURL"`
	ACKNotificationURL    string            `json:"ackNotificationURL"`
	ErrorNotificationURL  string            `json:"errorNotificationURL"`
	StatusNotificationURL string            `json:"statusNotificationURL"`
}

HandlerConfig contains the configuration for a HTTP handler.

func (HandlerConfig) Validate

func (c HandlerConfig) Validate() error

Validate validates the HandlerConfig data.

Jump to

Keyboard shortcuts

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