package
0.0.0-20240419152841-55d3967a4c8a
Repository: https://github.com/workiva/go-rest.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

BadRequest returns a Error for a 400 Bad Request error.
CustomError returns an Error for the given HTTP status code.
InternalServerError returns a Error for a 500 Internal Server error.
MethodNotAllowed returns a Error for a 405 Method Not Allowed error.
NewAPI returns a newly allocated API instance.
NewConfiguration returns a default Configuration.
NewContext returns a RequestContext populated with parameters from the request path and query string.
No description provided by the author
NewResponse constructs a new response struct containing the payload to send back.
No description provided by the author
NewRules returns a set of Rules for use by a ResourceHandler.
ResourceConflict returns a Error for a 409 Conflict error.
ResourceNotFound returns a Error for a 404 Not Found error.
ResourceNotPermitted returns a Error for a 403 Forbidden error.
UnauthorizedRequest returns a Error for a 401 Unauthorized error.
UnprocessableRequest returns a Error for a 422 Unprocessable Entity error.

# Constants

Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Handler names.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Rule category Filters.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Rule category Filters.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.
Type constants define the data types that Rules can specify for coercion.

# Structs

BaseResourceHandler is a base implementation of ResourceHandler with stubs for the CRUD operations.
Client is the type that encapsulates and uses the Authorizer to sign any REST requests that are performed.
Configuration contains settings for configuring an API.
Error is an implementation of the error interface representing an HTTP error.
MiddlewareError is returned by Middleware to indicate that a request should not be served.
Response is unmarshaled struct returned from an HTTP request.
Wraps response decoding error in a helpful way.
Rule provides schema validation and type coercion for request input and fine-grained control over response output.

# Interfaces

API is the top-level interface encapsulating an HTTP REST server.
HttpClient is the type that is used to perform HTTP Methods.
RequestContext contains the context information for the current HTTP request.
Resource represents a domain model.
ResourceHandler specifies the endpoint handlers for working with a resource.
ResponseSerializer is responsible for serializing REST responses and sending them back to the client.
RestClient performs HTTP methods including Get, Post, Put, and Delete.
Rules is a collection of Rules and a reflect.Type which they correspond to.
An interface satisfied by log.Logger.

# Type aliases

Address is the address and port to bind to (e.g.
ClientMiddleware is a function that wraps another function, and returns the wrapped function.
FilePath represents a file path.
Filter is a category for filtering Rules.
No description provided by the author
InvocationHandler is a function that is to be wrapped by the ClientMiddleware.
Middleware can be passed in to API#Start and API#StartTLS and will be invoked on every request to a route handled by the API.
Payload is the unmarshalled request body.
RequestMiddleware is a function that returns a Handler wrapping the provided Handler.
RouteVars is a map of URL route variables to values.
Type is a data type to coerce a value to specified with a Rule.