package
0.0.0-20200802004238-a7413d3a5c41
Repository: https://github.com/dophin2009/nao.git
Documentation: pkg.go.dev

# Functions

CurrentStatus retrieves information about the API at the current time and returns it as an APIStatus object.
EncodeResponseBody encodes the given value into the response body of the given ResponseWriter.
EncodeResponseError encodes an error response into the response body of the given ResponseWriter.
EncodeResponseErrorBadRequest encodes an error response with status code BadRequest.
EncodeResponseErrorInternalServer encodes an error response with status code InternalServerError.
EncodeResponseErrorUnauthorized encodes an error response with status code Unauthorized.
ErrorResponseNew returns a new instance of errorResponse for the current time.
NewServer returns a new instance of Controller.
ParsePathVar returns the string value of a path variable with the given name.
ParsePathVarInt returns the int value of a path variable with the given name.
ReadRequestBody reads and returns the request body of the given HTTP request.

# Constants

ErrorAuthentication is the generic error message given when the user failed to authenticate.
ErrorInternalServer is the generic error message given when an error was encountered in the server.
ErrorPathVariableParsing is the generic error message given when some path variable could not be parsed properly.
ErrorRequestBodyParsing is the generic error message given when HTTP request body could not be parsed.
ErrorRequestBodyReading is the generic error message given when HTTP request body could not be read.
HeaderContentType is a HTTP header name that states the structure of the response body.
HeaderContentTypeValJSON is a value for the content type header for JSON.

# Structs

AuthenticationError is raised when the user fails to authenticate.
ErrorResponse represents an error message to be returned to the client if an error is encountered.
Handler is a single HTTP request handler.
Server represents the API controller layer.
Status contains information about the API at the current time.

# Interfaces

HandlerGroup is a group of handlers that have some shared properties.

# Type aliases

HTTPReciever is a type alias for functions that handle HTTP requests.