mirror of
https://github.com/glanceapp/glance.git
synced 2025-08-15 02:38:46 +02:00
Update docs and remove struct
This commit is contained in:
@ -445,10 +445,8 @@ The following functions are available on the `JSON` object:
|
|||||||
- `Float(key string) float`: Returns the value of the key as a float.
|
- `Float(key string) float`: Returns the value of the key as a float.
|
||||||
- `Bool(key string) bool`: Returns the value of the key as a boolean.
|
- `Bool(key string) bool`: Returns the value of the key as a boolean.
|
||||||
- `Array(key string) []JSON`: Returns the value of the key as an array of `JSON` objects.
|
- `Array(key string) []JSON`: Returns the value of the key as an array of `JSON` objects.
|
||||||
- `Object(key string)`: Returns the value of the key as a list of properties.
|
|
||||||
- `.Key`: the property name
|
|
||||||
- `.Value`: the property value
|
|
||||||
- `Exists(key string) bool`: Returns true if the key exists in the JSON object.
|
- `Exists(key string) bool`: Returns true if the key exists in the JSON object.
|
||||||
|
- `Entries(key string)`: Returns an iterator that allows you to loop through each property of the object. Example: `{{ range $key, $value := .JSON.Entries "user" }}`. This will yield pairs of key and value, where `$key` is a string and `$value` is a `JSON` object.
|
||||||
|
|
||||||
The following functions are available on the `Options` object:
|
The following functions are available on the `Options` object:
|
||||||
|
|
||||||
|
@ -358,11 +358,6 @@ type decoratedGJSONResult struct {
|
|||||||
gjson.Result
|
gjson.Result
|
||||||
}
|
}
|
||||||
|
|
||||||
type ObjectProperty struct {
|
|
||||||
Key string
|
|
||||||
Value decoratedGJSONResult
|
|
||||||
}
|
|
||||||
|
|
||||||
func gJsonResultArrayToDecoratedResultArray(results []gjson.Result) []decoratedGJSONResult {
|
func gJsonResultArrayToDecoratedResultArray(results []gjson.Result) []decoratedGJSONResult {
|
||||||
decoratedResults := make([]decoratedGJSONResult, len(results))
|
decoratedResults := make([]decoratedGJSONResult, len(results))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user