http

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpgradeHttp added in v0.6.0

func UpgradeHttp(r *http.Request, w http.ResponseWriter, bus core.Bus)

UpgradeHttp request to websocket and handle communication

func WrapContext

func WrapContext(ctx *gin.Context) core.HTTPContext

WrapContext wraps gin.Context into core.HTTPContext

Types

type Handler

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

Handler for HTTP request

func CreateHandler

func CreateHandler(addr string) *Handler

CreateHandler for HTTP request

func (*Handler) AddAPIEndpoints

func (h *Handler) AddAPIEndpoints(entries []core.PathEntry)

AddAPIEndpoints to HTTP handler

func (*Handler) AddBaseEndpoints

func (h *Handler) AddBaseEndpoints(entries []core.PathEntry)

AddBaseEndpoints to HTTP handler

func (*Handler) AddWebEndpoints

func (h *Handler) AddWebEndpoints(entries []core.PathEntry)

AddWebEndpoints to HTTP handler

func (*Handler) Shutdown

func (h *Handler) Shutdown()

Shutdown http interface

type WSRequest added in v0.6.0

type WSRequest struct {
	// Type of request (event, widget_action, ...)
	Type string `json:"type"`

	// Id of action (event id, widget id, ...
	ID string `json:"id"`

	// Data of request
	Data map[string]interface{} `json:"data"`

	// Reference to another request (request_response -> original request)
	Reference *WSRequest `json:"reference"`
}

WSRequest send through web socket

type WsClient added in v0.6.0

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

WsClient communicates with dashboard in the browser

func NewWsClient added in v0.6.0

func NewWsClient(conn net.Conn, bus core.Bus) *WsClient

NewWsClient creates client for websocket communication

func (*WsClient) Run added in v0.6.0

func (c *WsClient) Run()

Run communication handling

Jump to

Keyboard shortcuts

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