package
0.0.57
Repository: https://github.com/aarondl/oa3.git
Documentation: pkg.go.dev

# Functions

AddErrs adds errors to an error map and returns the map eg.
AddErrsFlatten flattens toAdd by adding key on to the errors inside toAdd eg.
ExplodedFormArrayToSlice simply takes an array gathered from color=blue&color=black and converts it into []T using a conversion function.
FlatFormArrayToSlice takes the first value from the form color=blue,black&color=yellow (ie.
MergeErrs merges src's keys and values into dst.
ReadJSON reads JSON from the body and ensures the body is closed.
ReadJSONBuffer is like ReadJSON but does not put back its buffer, instead it allows further use, must end with a ReturnJSONBuffer call.
ReturnJSONBuffer is called to return a buffer to the pool.
StringNoOp is used to prevent extra special cases where other types will require conversion.
StringToBool conversion.
StringToChronoDate checks for an RFC3339 "date" production using chrono library.
StringToChronoDateTime parses an RFC3339 "date-time" production using chrono library.
StringToChronoTime parses an RFC3339 "time" production using chrono library.
StringToDate checks for an RFC3339 "date" production as time.Time.
StringToDateTime parses an RFC3339 "date-time" production as time.Time.
StringToDecimal converts a string to a decimal type.
StringToDuration parses an RFC3339 "duration" production.
StringToFloat conversion.
StringToInt conversion.
StringToString is a somewhat useless function but handy for using in tandem with a Map() like function over a slice to convert a string to a specialized version of a string and back.
StringToTime parses an RFC3339 "time" production as time.Time.
StringToUint conversion.
StringToUUID converts a string to a uuid type.
ValidateEnum validates a string against a whitelisted set of values.
ValidateFormatDecimal checks it look like it's in a decimal shape.
ValidateFormatUUIDv4 checks that it look like it's in a UUID v4 shape.
ValidateMaxItems ensures a array's length is <= max.
ValidateMaxLength ensures a string's length is <= max.
ValidateMaxNumber checks that val <= max or if exclusive then val < max.
ValidateMaxProperties ensures a map[string]X's length is <= max.
ValidateMaxDecimal checks that val <= max or if exclusive then val < max.
ValidateMinItems ensures an array's length is >= min.
ValidateMinLength ensures a string's length is >= min.
ValidateMinNumber checks that val >= min or if exclusive then val > min.
ValidateMinProperties ensures a map[string]X's length is >= min.
ValidateMinDecimal checks that val >= min or if exclusive then val > min.
ValidateMultipleOfInt checks that val % factor == 0.
ValidateMultipleOfInt checks that val % factor == 0.
ValidatePattern validates a string against a pattern.
ValidateUniqueItems ensures an arrays items are unique.
WriteJSON uses a pool of buffers to write into.

# Variables

ErrNoBody is returned from a handler and expected to be handled by ErrorHandler in some useful way for the application.

# Structs

UnmarshalBodyError is returned from a handler and expected to be handled by ErrorHandler.

# Interfaces

ErrorHandler is an adapter that allows routing to special http.HandlerFuncs that additionally have an error return.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author