Documentation ¶
Index ¶
- Constants
- func GenerateEtag() (string, error)
- func GenerateReferenceNumber() string
- func GetCompanyNumberFromVars(vars map[string]string) (string, error)
- func WriteJSON(w http.ResponseWriter, r *http.Request, data interface{})
- func WriteJSONWithStatus(w http.ResponseWriter, r *http.Request, data interface{}, status int)
Constants ¶
View Source
const AdminPenaltyLookupRole = "/admin/penalty-lookup"
AdminPenaltyLookupRole defines the path to check whether a user is authorised to look up a penalty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEtag ¶
GenerateEtag generates a random etag which is generated on every write action
func GenerateReferenceNumber ¶
func GenerateReferenceNumber() string
GenerateReferenceNumber produces a random reference number in the format of [A-Z]{2}[0-9]{8}
func GetCompanyNumberFromVars ¶
GetCompanyNumberFromVars returns the company number from the supplied request vars.
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, r *http.Request, data interface{})
WriteJSON writes the interface as a json string with status of 200.
func WriteJSONWithStatus ¶
func WriteJSONWithStatus(w http.ResponseWriter, r *http.Request, data interface{}, status int)
WriteJSONWithStatus writes the interface as a json string with the supplied status.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.