Documentation
¶
Index ¶
Constants ¶
const DefaultLimit = 20
const DefaultOffset = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API provides a struct to wrap the api around
func New ¶
func New(ctx context.Context, cfg *config.Config, r chi.Router, idc *identity.Client, rsp responder, g generator, d datastore, ds datasetAPIClient, c cantabularClient) *API
New creates and initialises a new API
func (*API) ParseRequest ¶
ParseRequest attemts to read unmarshal a request body into a request object, returning an appropriate error on failure. 'req' must be a pointer to a struct. ParseRequest will also attempt to call the request's Valid() function if it has one and will throw an error if it fails
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is the packages error type
func (Error) LogData ¶
LogData satisfies the dataLogger interface which is used to recover log data from an error
func (Error) Message ¶
Message satisfies the messanger interface which is used to specify a response to be sent to the caller in place of the error text for a given error. This is useful when you don't want sensitive information or implementation details being exposed to the caller which could be used to find exploits in our API