package webapi
Constants
VersionPrefix
"/v1"
HelpPath
"/help"
DefaultPort
1337
Variables
ErrMissingAPIKey
errors.New("webapi: missing API key")
ErrDuplicateRoute
errors.New("webapi: duplicate route")
ErrInvalidRoute
errors.New("webapi: invalid route")
Functions
Address
MustRegister[T any]
Register[T any]
Types
Config
struct
Endpoint
interface
type Endpoint[T any] interface {
Routes() []Route
ServeEditorWebAPI(editor T, w http.ResponseWriter, r *http.Request)
}
HelpResponse
struct
Route
struct
type Route struct {
Method string `json:"method"`
Path string `json:"path"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
}
Server
struct