decoder

package
v1.6.65 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUFFER_SIZE = 1024
	SEPARATOR   = ", "
)
View Source
const (
	SEVERITY_FATAL uint8 = 2 + iota // value as log/syslog.LOG_CRIT
	SEVERITY_ERROR                  // value as log/syslog.LOG_ERR
	SEVERITY_WARN                   // value as log/syslog.LOG_WARN
	SEVERITY_INFO                   // value as log/syslog.LOG_INFO
	SEVERITY_DEBUG                  // value as log/syslog.LOG_DEBUG
	SEVERITY_TRACE
	SEVERITY_UNKNOWN
)

Variables

View Source
var SeverityMap = map[string]uint8{
	"FATAL": SEVERITY_FATAL,
	"ERROR": SEVERITY_ERROR,
	"WARN":  SEVERITY_WARN,
	"INFO":  SEVERITY_INFO,
	"DEBUG": SEVERITY_DEBUG,
	"TRACE": SEVERITY_TRACE,

	"FATAL2": SEVERITY_FATAL,
	"ERROR2": SEVERITY_ERROR,
	"WARN2":  SEVERITY_WARN,
	"INFO2":  SEVERITY_INFO,
	"DEBUG2": SEVERITY_DEBUG,
	"TRACE2": SEVERITY_TRACE,

	"FATAL3": SEVERITY_FATAL,
	"ERROR3": SEVERITY_ERROR,
	"WARN3":  SEVERITY_WARN,
	"INFO3":  SEVERITY_INFO,
	"DEBUG3": SEVERITY_DEBUG,
	"TRACE3": SEVERITY_TRACE,

	"FATAL4": SEVERITY_FATAL,
	"ERROR4": SEVERITY_ERROR,
	"WARN4":  SEVERITY_WARN,
	"INFO4":  SEVERITY_INFO,
	"DEBUG4": SEVERITY_DEBUG,
	"TRACE4": SEVERITY_TRACE,

	"CRITICAL": SEVERITY_FATAL,
	"WARNING":  SEVERITY_WARN,
	"ERRO":     SEVERITY_ERROR,
	"DEBU":     SEVERITY_DEBUG,
	"FATA":     SEVERITY_FATAL,
	"CRIT":     SEVERITY_FATAL,
}

Functions

func StringToSeverity

func StringToSeverity(str string) uint8

Types

type AppLogEntry

type AppLogEntry struct {
	LogType    string `json:"_df_log_type"`
	UserID     int    `json:"user_id"`
	OrgID      int    `json:"org_id"`
	Kubernetes struct {
		PodName string `json:"pod_name"`
		PodIp   string `json:"pod_ip"`
	} `json:"kubernetes"`
	Message    string      `json:"message"`
	Json       interface{} `json:"json"`
	Level      string      `json:"level"`
	Timestamp  string      `json:"timestamp"`
	AppService string      `json:"app_service"`
}

type Counter

type Counter struct {
	InCount    int64 `statsd:"in-count"`
	OutCount   int64 `statsd:"out-count"`
	ErrorCount int64 `statsd:"err-count"`
}

type Decoder

type Decoder struct {
	utils.Closable
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(
	index int,
	msgType datatype.MessageType,
	inQueue queue.QueueReader,
	logWriter *dbwriter.AppLogWriter,
	platformData *grpc.PlatformInfoTable,
	config *config.Config,
) *Decoder

func (*Decoder) GetCounter

func (d *Decoder) GetCounter() interface{}

func (*Decoder) Run

func (d *Decoder) Run()

func (*Decoder) WriteAgentLog

func (d *Decoder) WriteAgentLog(agentId uint16, bs []byte) error

func (*Decoder) WriteAppLog

func (d *Decoder) WriteAppLog(agentId uint16, l *AppLogEntry) error

Jump to

Keyboard shortcuts

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