package
0.0.0-20180514003231-2e5e46368436
Repository: https://github.com/cactusdev/xerophi.git
Documentation: pkg.go.dev
# Functions
FieldTag looks up a single field in the provided object and returns the tag for it.
GetFromOffset generates a human-readable line/character error from a JSON error's offset.
GetResourceID tries to extract the ID from data given.
GetTags takes a reflect.StructField object and returns a slice of the associated tags.
MapStringToInterface converts map[string]string to a map[string]interface{}.
MarshalResponse takes an object that implements the JSONAPISchema interface and marshals it to a map[string]interface{} Sub-structs will be placed automatically under their parent (meta/attr) so there is no need to have that tag on any sub-struct.
NiceError factors away the erroring of a function into a clean single-line function call.
ReturnTags takes an interface and a string to look up the tag for.
ValidateAndMap takes an io reader (most like io.ReadCloser from the request), reads in the data, and then validates it against the JSONSchema provided.
ValidateInput valids the data provided against the provided JSON schema Will only return an error if there's a problem with the data.
# Interfaces
JSONAPISchema is an interface used for generating the proper JSON API response packet.