backend

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(inheritLog *slog.Logger) error

Types

type Batch

type Batch interface {
	Pick(*Message) (bool, error)
	Flush() error
}

NewBatch must return these interface

type BatchList

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

func NewBatch

func NewBatch() (*BatchList, error)

func (*BatchList) Flush

func (bl *BatchList) Flush() error

func (*BatchList) Pick

func (bl *BatchList) Pick(m *Message, isNotDecoded bool) error

type InitFunction

type InitFunction func() error

Plugin must implement Init() function with the following type

type Message

type Message struct {
	Date     time.Time
	Facility int
	Severity int
	Hostname string
	Process  string
	Pid      int
	Data     string
}

this struct is the representation of syslog message.

type NewBatchFunction

type NewBatchFunction func() (Batch, error)

Plugin must implement NewBatch() function with the following type

type TransactionOps

type TransactionOps interface {
	Append(...interface{}) error
	Flush() error
}

func NewTransaction

func NewTransaction(table string, columns ...string) (TransactionOps, error)

NewBatch could use this function to initialise backend database transaction

Jump to

Keyboard shortcuts

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