Documentation
¶
Overview ¶
Package dataview provides a way to view Go values as tabular HTML if the values can be represented as JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func From ¶
From converts a Go value into HTML, converting it into JSON first and parsing it with GJSON.
func FromGJSON ¶
FromGJSON converts a GJSON result into HTML. This is the most efficient way to use dataview if you already have a GJSON result.
func FromJSON ¶
FromJSON converts a JSON document into HTML, parsing it with GJSON -- the provided JSON MUST be valid.
func Stylesheet ¶
Stylesheet will return the structural CSS needed to render the dataview. The options are currently ignored, but are present in case we need to add options like a class prefix in the future.
Types ¶
type Option ¶
type Option func(*config)
func Hook ¶
Hook registers a function that replaces how a value is rendered if the path to the value matches the provided pattern.
Patterns are regex patterns that match paths like .persons.0.name or .persons.0.address.city. If a hook returns nil, the default rendering is used.