gopapi

package module
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

gopapi

public API for LogDoc go plugins

Documentation

Overview

Package gopapi public API for LogDoc go plugins

Index

Constants

View Source
const (
	SOURCE_TIME     string = "tsrc"
	PROCESS_ID      string = "pid"
	LOG_SOURCE      string = "src"
	LEVEL           string = "lvl"
	ENTRY           string = "msg"
	RECEIVE_TIME    string = "trcv"
	SOURCE_IP       string = "ip"
	SOURCE_APP_NAME string = "app"
)
View Source
const (
	DEBUG int = iota
	INFO
	LOG
	WARN
	ERROR
	SEVERE
	PANIC
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionType

type ConnectionType struct {
	Tcp  bool   // true - tcp, false - udp
	Name string // unique name of the type
}

type LogEntry

type LogEntry struct {
	Ip      string
	SrcTime string
	RcvTime string
	Pid     string
	Source  string
	Entry   string
	AppName string
	Level   int
	// contains filtered or unexported fields
}

func NewEntry added in v0.1.5

func NewEntry() LogEntry

func (*LogEntry) FieldsNames added in v0.1.6

func (e *LogEntry) FieldsNames() []string

func (*LogEntry) GetField

func (e *LogEntry) GetField(name string) string

func (*LogEntry) LevelName added in v0.1.8

func (e *LogEntry) LevelName() string

func (*LogEntry) SetField

func (e *LogEntry) SetField(nameRaw string, value string)

type SinkPlugin

type SinkPlugin struct {
	// contains filtered or unexported fields
}

func (*SinkPlugin) Chunk

func (plug *SinkPlugin) Chunk(chunk []byte, source string, tcp bool) []byte

func (*SinkPlugin) Configure

func (plug *SinkPlugin) Configure(config *hocon.Config, consumer func(entry LogEntry))

func (*SinkPlugin) Init added in v0.1.3

func (plug *SinkPlugin) Init(lookup func(symName string) (plugin.Symbol, error)) error

func (*SinkPlugin) SupportedTypes

func (plug *SinkPlugin) SupportedTypes() []ConnectionType

Jump to

Keyboard shortcuts

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