httpserver

package
v0.9.3-beta.13 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Config

type Config struct {
	Port               int
	Address            string
	MaxRequestBodySize int
	UnixDomainSocket   string
	ReadBufferSize     int
	APILogging         bool
}

type Endpoint

type Endpoint struct {
	Method    string
	Route     string
	Version   string
	Duplicate string
	Handler   fasthttp.RequestHandler
}

type ErrorResponse

type ErrorResponse struct {
	ErrorCode string `json:"errorCode"`
	Message   string `json:"message"`
}

ErrorResponse is an HTTP response message sent back to calling clients.

func NewErrorResponse

func NewErrorResponse(errorCode, message string) ErrorResponse

NewErrorResponse returns a new ErrorResponse.

type OperationAPI

type OperationAPI interface {
	Endpoints() []Endpoint
	RegisterOperations(map[string]operations.Operation)
}

type Request

type Request struct {
	Data       interface{}    `json:"data,omitempty"`
	Parameters map[string]any `json:"parameters,omitempty"`
	Metadata   map[string]any `json:"metadata,omitempty"`
}

type Server

type Server interface {
	io.Closer
	Router() fasthttp.RequestHandler
	StartNonBlocking() error
}

Server is an interface for the Lorry HTTP server.

func NewServer

func NewServer(ops map[string]operations.Operation) Server

NewServer returns a new HTTP server.

Jump to

Keyboard shortcuts

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