Documentation ¶
Overview ¶
Package httphandler implements a HTTP handler
Index ¶
- Variables
- type Handler
- func (h *Handler) Close() error
- func (h *Handler) SendACKNotification(pl handler.ACKNotification) error
- func (h *Handler) SendDataUp(pl handler.DataUpPayload) error
- func (h *Handler) SendErrorNotification(pl handler.ErrorNotification) error
- func (h *Handler) SendJoinNotification(pl handler.JoinNotification) error
- func (h *Handler) SendLocationNotification(pl handler.LocationNotification) error
- func (h *Handler) SendStatusNotification(pl handler.StatusNotification) error
- type HandlerConfig
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) 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) SendLocationNotification ¶
func (h *Handler) SendLocationNotification(pl handler.LocationNotification) error
SendLocationNotification sends a location 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"` LocationNotificationURL string `json:"locationNotificationURL"` }
HandlerConfig contains the configuration for a HTTP handler.
func (HandlerConfig) Validate ¶
func (c HandlerConfig) Validate() error
Validate validates the HandlerConfig data.
Click to show internal directories.
Click to hide internal directories.