api

package
v0.0.0-...-2187358 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiPrefix = "/api"
)

Variables

View Source
var (
	ErrMalformed = errors.New("malformed api endpoint; should be /api/...")
)

Functions

This section is empty.

Types

type ApiHandler

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

ApiHandler implements Handler

func (*ApiHandler) HandleEndpoint

func (h *ApiHandler) HandleEndpoint(url *url.URL, w http.ResponseWriter, r *http.Request)

func (*ApiHandler) RegisterEndpoint

func (h *ApiHandler) RegisterEndpoint(e endpoint.ApiEndpoint)

func (*ApiHandler) ServeHTTP

func (h *ApiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ApiHandlerFunc

type ApiHandlerFunc func(w http.ResponseWriter, r *http.Request)

type Handler

type Handler interface {
	ServeHTTP(http.ResponseWriter, *http.Request)
}

Handler provides api handler methods and implements http.Handler

func NewHandler

func NewHandler(connHandler connection.ConnectionHandler) Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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