http

package
v0.0.0-...-4e3f075 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

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.

Documentation

Index

Constants

View Source
const (
	HeaderKey = "Authorization"
)
View Source
const (
	PluginHTTP = "http"
)

Constants

Variables

This section is empty.

Functions

func MiddlewareBasicAuthentication

func MiddlewareBasicAuthentication(username, password string, next http.Handler) http.Handler

func NewDevice

func NewDevice(ctx context.Context, ID string, config cmap.CustomMap, rxFunc func(msg *model.Message), statusFunc func(state *model.State)) (deviceType.Plugin, error)

New http client

Types

type Config

type Config struct {
	ListenAddress string `yaml:"listen_address"`
	IsAuthEnabled bool   `yaml:"is_auth_enabled"`
	Username      string `yaml:"username"`
	Password      string `yaml:"password" json:"-"`
}

Config details

type Endpoint

type Endpoint struct {
	ID     string
	Config *Config
	// contains filtered or unexported fields
}

Endpoint data

func (*Endpoint) Close

func (ep *Endpoint) Close() error

Close the driver

func (*Endpoint) Name

func (ep *Endpoint) Name() string

func (*Endpoint) Write

func (ep *Endpoint) Write(message *model.Message) error

type RequestData

type RequestData struct {
	Method          string              `json:"method"`
	RemoteAddress   string              `json:"remoteAddress"`
	Host            string              `json:"host"`
	Path            string              `json:"path"`
	Body            string              `json:"body"`
	QueryParameters map[string][]string `json:"queryParameters"`
	Headers         map[string][]string `json:"headers"`
	Timestamp       time.Time           `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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