Documentation ¶
Overview ¶
Package json handles ad-hoc JSON processing
Index ¶
- func GetJSONDataFromBuffer(log *zap.SugaredLogger, buffer []byte) (jsonData interface{}, err error)
- func GetJSONDataFromFile(log *zap.SugaredLogger, path string) (jsonData interface{}, err error)
- func GetJSONValue(log *zap.SugaredLogger, jsonData interface{}, jsonPath string) (jsonValue interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJSONDataFromBuffer ¶
func GetJSONDataFromBuffer(log *zap.SugaredLogger, buffer []byte) (jsonData interface{}, err error)
GetJSONDataFromBuffer Gets JsonData from a buffer. This is useful for when we extract a Json value out of something else. For example if there is Json data in an otherwise unstructured log message that we are looking at. Helm version is also an example where there is mixed text and Json, etc...
func GetJSONDataFromFile ¶
func GetJSONDataFromFile(log *zap.SugaredLogger, path string) (jsonData interface{}, err error)
GetJSONDataFromFile will open the specified JSON file, unmarshal it into a interface{}
func GetJSONValue ¶
func GetJSONValue(log *zap.SugaredLogger, jsonData interface{}, jsonPath string) (jsonValue interface{}, err error)
GetJSONValue gets a JSON value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.