utils

package
v0.1.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BoolStr           string = "bool"
	FloatStr          string = "float"
	Float64Str        string = "float64"
	StringStr         string = "string"
	IntStr            string = "int"
	Int64Str          string = "int64"
	SliceInterfaceStr string = "[]interface {}"
	MapStringStr      string = "map[string]string"
	MapIntStr         string = "map[string]int"
	MapInterfaceStr   string = "map[string]interface {}"
)

Variables

This section is empty.

Functions

func CheckParameters

func CheckParameters(parameters map[string]interface{}, name, typ string, reg *regexp.Regexp, mandatory bool) error

func PrintLog

func PrintLog(level, format string, line LogLine)

func RemoveAnsiCharacters

func RemoveAnsiCharacters(str string) string

func RemoveSpecialCharacters

func RemoveSpecialCharacters(input string) string

func SetFields

func SetFields(structure interface{}, fields map[string]interface{}) interface{}

Types

type LogLine

type LogLine struct {
	Objects        map[string]string `json:"objects,omitempty"`
	TraceID        string            `json:"trace_id,omitempty"`
	Rule           string            `json:"rule,omitempty"`
	Event          string            `json:"event,omitempty"`
	Message        string            `json:"message,omitempty"`
	Priority       string            `json:"priority,omitempty"`
	Source         string            `json:"source,omitempty"`
	Result         string            `json:"result,omitempty"`
	Notifier       string            `json:"notifier,omitempty"`
	Output         string            `json:"output,omitempty"`
	Actionner      string            `json:"actionner,omitempty"`
	Action         string            `json:"action,omitempty"`
	ActionCategory string            `json:"action_category,omitempty"`
	Error          string            `json:"error,omitempty"`
	Status         string            `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL