Documentation ¶
Overview ¶
Package pave allows generating a markdown spec for an API server that uses https://codeberg.org/vlbeaudoin/voki for defining its input and output types
Index ¶
- func EchoRegister[r voki.Requester[R], R voki.Responder](e *echo.Group, p *Pave, ...) error
- type Pave
- type PaveRoute
- func (pr PaveRoute[r, R]) Complete() bool
- func (pr PaveRoute[r, R]) Description() string
- func (pr PaveRoute[r, R]) Endpoint() string
- func (pr PaveRoute[r, R]) Identifier() string
- func (pr PaveRoute[r, R]) Method() string
- func (pr PaveRoute[r, R]) Prefix() string
- func (pr PaveRoute[r, R]) Register(p *Pave) error
- func (pr PaveRoute[r, R]) Request() r
- func (pr PaveRoute[r, R]) RequestString() string
- func (pr PaveRoute[r, R]) Response() R
- func (pr PaveRoute[r, R]) ResponseString() string
- func (pr *PaveRoute[r, R]) SetDescription(description string) error
- func (pr *PaveRoute[r, R]) SetEndpoint(endpoint string) error
- func (pr *PaveRoute[r, R]) SetIdentifier(identifier string) error
- func (pr *PaveRoute[r, R]) SetMethod(method string) error
- func (pr *PaveRoute[r, R]) SetPrefix(prefix string) error
- func (pr *PaveRoute[r, R]) SetRequest(request r) error
- func (pr *PaveRoute[r, R]) SetResponse(response R) error
- func (pr PaveRoute[r, R]) String() (result string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EchoRegister ¶
func EchoRegister[r voki.Requester[R], R voki.Responder](e *echo.Group, p *Pave, prefix, method, endpoint, description, identifier string, handlerFunc echo.HandlerFunc) error
EchoRegister allows registering a route with pave and declare a corresponding echo handler
Types ¶
type Pave ¶
type Pave struct {
// contains filtered or unexported fields
}
func (*Pave) AddRouteString ¶
func (Pave) RouteStrings ¶
RouteStrings returns the markdown route specs
func (Pave) SortedRouteStrings ¶
SortedRouteStrings returns the sorted markdown route specs
type PaveRoute ¶
type PaveRoute[r voki.Requester[R], R voki.Responder] struct {
// contains filtered or unexported fields
}
func NewPaveRoute ¶
func (PaveRoute[r, R]) Description ¶
func (PaveRoute[r, R]) Identifier ¶
func (PaveRoute[r, R]) RequestString ¶
RequestString returns the PaveRoute.Request as indented JSON
func (PaveRoute[r, R]) ResponseString ¶
ResponseString returns the PaveRoute.Response as indented JSON
func (*PaveRoute[r, R]) SetDescription ¶
func (*PaveRoute[r, R]) SetEndpoint ¶
func (*PaveRoute[r, R]) SetIdentifier ¶
func (*PaveRoute[r, R]) SetRequest ¶
func (*PaveRoute[r, R]) SetResponse ¶
Click to show internal directories.
Click to hide internal directories.