Documentation
¶
Overview ¶
Package logs provides a way to parse and get the logs of a pod
Index ¶
- func AssertQueryRecord(logEntries []map[string]interface{}, errorTestQuery string, message string, ...) bool
- func CheckOptionsForBarmanCommand(logEntries []map[string]interface{}, message, backupName, podName string, ...) (bool, error)
- func CheckRecordForQuery(entry map[string]interface{}, errorTestQuery, user, database, message string) bool
- func HasLogger(logEntries []map[string]interface{}, logger string) bool
- func IsWellFormedLogForLogger(item map[string]interface{}, loggerField string) bool
- func ParseJSONLogs(ctx context.Context, kubeInterface kubernetes.Interface, namespace string, ...) ([]map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertQueryRecord ¶
func AssertQueryRecord(logEntries []map[string]interface{}, errorTestQuery string, message string, logger string) bool
AssertQueryRecord verifies if any of the message record field of each JSON row contains the expectedResult string, then applies the assertions related to the log format
func CheckOptionsForBarmanCommand ¶
func CheckOptionsForBarmanCommand( logEntries []map[string]interface{}, message, backupName, podName string, optionsExpected []string, ) (bool, error)
CheckOptionsForBarmanCommand checks if the expected options are used from the barman command execution log
func CheckRecordForQuery ¶
func CheckRecordForQuery(entry map[string]interface{}, errorTestQuery, user, database, message string) bool
CheckRecordForQuery applies some assertions related to the format of the JSON log fields keys and values
func IsWellFormedLogForLogger ¶
IsWellFormedLogForLogger verifies if the message record field of the given map contains the expectedResult string. If the message field matches the expectedResult, then the related record is returned. Otherwise return nil.
func ParseJSONLogs ¶
func ParseJSONLogs( ctx context.Context, kubeInterface kubernetes.Interface, namespace string, podName string, ) ([]map[string]interface{}, error)
ParseJSONLogs returns the pod's logs of a given pod name, in the form of a list of JSON entries
Types ¶
This section is empty.