Documentation ¶
Index ¶
Constants ¶
const ( RFC822TimeFormatName = "rfc822" ISO8601TimeFormatName = "iso8601" UnixTimeFormatName = "unixTimestamp" )
Names of time formats supported by the SDK
const ( // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" // This format is used for output time without seconds precision RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" // This format is used for output time with fractional second precision up to milliseconds ISO8601OutputTimeFormat = "2006-01-02T15:04:05.999999999Z" )
Time formats supported by the SDK Output time is intended to not contain decimals
Variables ¶
This section is empty.
Functions ¶
func EncodeJSONValue ¶
func EncodeJSONValue(v JSONValue, escape EscapeMode) (string, error)
EncodeJSONValue marshals the value into a JSON string, and optionally base64 encodes the string before returning it.
Will panic if the escape mode is unknown.
func FormatTime ¶
FormatTime returns a string value of the time.
func IsKnownTimestampFormat ¶
IsKnownTimestampFormat returns if the timestamp format name is know to the SDK's protocols.
Types ¶
type EscapeMode ¶
type EscapeMode uint
EscapeMode is the mode that should be use for escaping a value
const ( NoEscape EscapeMode = iota Base64Escape QuotedEscape )
The modes for escaping a value before it is marshaled, and unmarshaled.
type JSONValue ¶
type JSONValue map[string]interface{}
JSONValue is a representation of a grab bag type that will be marshaled into a json string. This type can be used just like any other map.
Example: values := JSONValue{ "Foo": "Bar", } values["Baz"] = "Qux"
func DecodeJSONValue ¶
func DecodeJSONValue(v string, escape EscapeMode) (JSONValue, error)
DecodeJSONValue will attempt to decode the string input as a JSONValue. Optionally decoding base64 the value first before JSON unmarshaling.
Will panic if the escape mode is unknown.