Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormatConfig ¶
FormatConfig is the format configuration used.
func Format ¶
func Format(userRows *gateway.TableData, opts ...FormatOption) ([]byte, FormatConfig, error)
Format transforms the user rows according to the provided configuration, retuning raw json or jsonl bytes.
type FormatOption ¶
type FormatOption func(*FormatConfig)
FormatOption controls the behavior of calls to Format.
func WithExtract ¶
func WithExtract(extract bool) FormatOption
WithExtract specifies whether or not to extract the JSON object from the single property of the surrounding JSON object. Default is false.
func WithOutput ¶
func WithOutput(output Output) FormatOption
WithOutput specifies the output format. Default is Table.
func WithUnwrap ¶
func WithUnwrap(unwrap bool) FormatOption
WithUnwrap specifies whether or not to unwrap the returned JSON objects from their surrounding array. Default is false.
type Output ¶
type Output string
Output is used to control the output format of a query specified with the "output" query param.
func OutputFromString ¶
OutputFromString converts a string into an Output.