http

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package http implements a HTTP integration.

Index

Constants

This section is empty.

Variables

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

errors

Functions

This section is empty.

Types

type Config

type Config 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"`
}

Config contains the configuration for the HTTP integration.

func (Config) Validate

func (c Config) Validate() error

Validate validates the HandlerConfig data.

type Integration

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

Integration implements a HTTP integration.

func New

func New(conf Config) (*Integration, error)

New creates a new HTTP integration.

func (*Integration) Close

func (i *Integration) Close() error

Close closes the handler.

func (*Integration) DataDownChan

func (i *Integration) DataDownChan() chan integration.DataDownPayload

DataDownChan return nil.

func (*Integration) SendACKNotification

func (i *Integration) SendACKNotification(ctx context.Context, pl integration.ACKNotification) error

SendACKNotification sends an ACK notification.

func (*Integration) SendDataUp

func (i *Integration) SendDataUp(ctx context.Context, pl integration.DataUpPayload) error

SendDataUp sends a data-up payload.

func (*Integration) SendErrorNotification

func (i *Integration) SendErrorNotification(ctx context.Context, pl integration.ErrorNotification) error

SendErrorNotification sends an error notification.

func (*Integration) SendJoinNotification

func (i *Integration) SendJoinNotification(ctx context.Context, pl integration.JoinNotification) error

SendJoinNotification sends a join notification.

func (*Integration) SendLocationNotification

func (i *Integration) SendLocationNotification(ctx context.Context, pl integration.LocationNotification) error

SendLocationNotification sends a location notification.

func (*Integration) SendStatusNotification

func (i *Integration) SendStatusNotification(ctx context.Context, pl integration.StatusNotification) error

SendStatusNotification sends a status notification.

Jump to

Keyboard shortcuts

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