server

package
v0.1.0-pre-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebSocketUpgrader

func NewWebSocketUpgrader() *websocket.Upgrader

NewWebSocketUpgrader creates a new websocket.Ugprader.

Types

type CustomValidator

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

CustomValidator used to validate incoming payloads (for now). https://echo.labstack.com/guide/request#validate-data

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

Validate incoming payloads (for now) that contain the struct tag `validate:"required"`.

type ErrorResponse

type ErrorResponse struct {
	Error interface{} `json:"error"`
}

ErrorResponse wraps `error` into a JSON object.

type MessageOut

type MessageOut struct {
	Number int    `json:"number"`
	Type   string `json:"type"`
}

MessageOut is the structure of the message that gets sent to the WebSocket client.

type Server

type Server struct {
	*echo.Echo // Wrap (using composition) *echo.Echo, allows us to pretend Server is echo.Echo.
	// contains filtered or unexported fields
}

Server wraps *echo.Echo and stores the proxy once configured.

func NewServer

func NewServer(checker model.ConditionalityChecker) *Server

NewServer returns new echo.Echo server.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown the server and the proxy if it is alive

type ValidationRunsIDResponse

type ValidationRunsIDResponse struct {
	Status string `json:"status"`
}

ValidationRunsIDResponse is the response to the `/api/validation-runs/:id` endpoint.

type ValidationRunsResponse

type ValidationRunsResponse struct {
	ID string `json:"id"`
}

ValidationRunsResponse is the response to the `/api/validation-runs` endpoint.

type WebSocketHandler

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

WebSocketHandler for handling WebSocket connections.

func (*WebSocketHandler) Handle

func (h *WebSocketHandler) Handle(c echo.Context) error

Handle a single WebSocket connection. GET /api/ws

Jump to

Keyboard shortcuts

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