http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 17 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"`
	EventEndpointURL string            `json:"eventEndpointURL"`
	Marshaler        string            `json:"marshaler"`
	Timeout          time.Duration     `json:"timeout"`

	// For backwards compatibility.
	DataUpURL                  string `json:"dataUpURL"`
	JoinNotificationURL        string `json:"joinNotificationURL"`
	ACKNotificationURL         string `json:"ackNotificationURL"`
	ErrorNotificationURL       string `json:"errorNotificationURL"`
	StatusNotificationURL      string `json:"statusNotificationURL"`
	LocationNotificationURL    string `json:"locationNotificationURL"`
	TxAckNotificationURL       string `json:"txAckNotificationURL"`
	IntegrationNotificationURL string `json:"integrationNotificationURL"`
}

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(m marshaler.Type, 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 models.DataDownPayload

DataDownChan return nil.

func (*Integration) HandleAckEvent

func (i *Integration) HandleAckEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.AckEvent) error

HandleAckEvent sends an AckEvent.

func (*Integration) HandleErrorEvent

func (i *Integration) HandleErrorEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.ErrorEvent) error

HandleErrorEvent sends an ErrorEvent.

func (*Integration) HandleIntegrationEvent

func (i *Integration) HandleIntegrationEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.IntegrationEvent) error

HandleIntegrationEvent sends an IntegrationEvent.

func (*Integration) HandleJoinEvent

func (i *Integration) HandleJoinEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.JoinEvent) error

HandleJoinEvent sends a JoinEvent.

func (*Integration) HandleLocationEvent

func (i *Integration) HandleLocationEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.LocationEvent) error

HandleLocationEvent sends a LocationEvent.

func (*Integration) HandleStatusEvent

func (i *Integration) HandleStatusEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.StatusEvent) error

HandleStatusEvent sends a StatusEvent.

func (*Integration) HandleTxAckEvent

func (i *Integration) HandleTxAckEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.TxAckEvent) error

HandleTxAckEvent sends a TxAckEvent.

func (*Integration) HandleUplinkEvent

func (i *Integration) HandleUplinkEvent(ctx context.Context, _ models.Integration, vars map[string]string, pl pb.UplinkEvent) error

HandleUplinkEvent sends an UplinkEvent.

Jump to

Keyboard shortcuts

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