consumers

package
v2.1.1--alpha+incompat... Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BATCH_DEFAULT_MAX = 50
)
View Source
const (
	CHANNEL_SIZE = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchConsumer

type BatchConsumer struct {
	Url        string
	Max        int
	DataBuffer []structs.EventData
	ItemBuffer []structs.Item
	Timeout    time.Duration
	// contains filtered or unexported fields
}

func InitBatchConsumer

func InitBatchConsumer(url string, max, timeout int) (*BatchConsumer, error)

func (*BatchConsumer) Close

func (c *BatchConsumer) Close() error

func (*BatchConsumer) Flush

func (c *BatchConsumer) Flush() error

func (*BatchConsumer) ItemSend

func (c *BatchConsumer) ItemSend(item structs.Item) error

func (*BatchConsumer) Send

func (c *BatchConsumer) Send(data structs.EventData) error

type ConcurrentLogWriter

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

func InitConcurrentLogWriter

func InitConcurrentLogWriter(fname string, hourRotate bool) (*ConcurrentLogWriter, error)

func (*ConcurrentLogWriter) Close

func (w *ConcurrentLogWriter) Close()

func (*ConcurrentLogWriter) Flush

func (w *ConcurrentLogWriter) Flush()

func (*ConcurrentLogWriter) Write

func (w *ConcurrentLogWriter) Write(data structs.EventData) error

type ConcurrentLoggingConsumer

type ConcurrentLoggingConsumer struct {
	Fname string
	Hour  bool
	// contains filtered or unexported fields
}

func InitConcurrentLoggingConsumer

func InitConcurrentLoggingConsumer(fname string, hour bool) (*ConcurrentLoggingConsumer, error)

func (*ConcurrentLoggingConsumer) Close

func (c *ConcurrentLoggingConsumer) Close() error

func (*ConcurrentLoggingConsumer) Flush

func (c *ConcurrentLoggingConsumer) Flush() error

func (*ConcurrentLoggingConsumer) ItemSend

func (c *ConcurrentLoggingConsumer) ItemSend(item structs.Item) error

func (*ConcurrentLoggingConsumer) Send

type Consumer

type Consumer interface {
	Send(data structs.EventData) error
	Flush() error
	Close() error
	ItemSend(item structs.Item) error
}

type DebugConsumer

type DebugConsumer struct {
	Url       string
	WriteData bool
	Timeout   time.Duration
}

func InitDebugConsumer

func InitDebugConsumer(surl string, writeData bool, timeout int) (*DebugConsumer, error)

func (*DebugConsumer) Close

func (c *DebugConsumer) Close() error

func (*DebugConsumer) Flush

func (c *DebugConsumer) Flush() error

func (*DebugConsumer) ItemSend

func (c *DebugConsumer) ItemSend(item structs.Item) error

func (*DebugConsumer) Send

func (c *DebugConsumer) Send(data structs.EventData) error

type DefaultConsumer

type DefaultConsumer struct {
	Url     string
	Timeout time.Duration
}

func InitDefaultConsumer

func InitDefaultConsumer(url string, timeout int) (*DefaultConsumer, error)

func (*DefaultConsumer) Close

func (c *DefaultConsumer) Close() error

func (*DefaultConsumer) Flush

func (c *DefaultConsumer) Flush() error

func (*DefaultConsumer) ItemSend

func (c *DefaultConsumer) ItemSend(item structs.Item) error

func (*DefaultConsumer) Send

func (c *DefaultConsumer) Send(data structs.EventData) error

type LogWriter

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

func InitLogWriter

func InitLogWriter(fname string, hourRotate bool) (*LogWriter, error)

func (*LogWriter) Close

func (w *LogWriter) Close()

func (*LogWriter) Flush

func (w *LogWriter) Flush()

func (*LogWriter) Write

func (w *LogWriter) Write(data structs.EventData) error

type LoggingConsumer

type LoggingConsumer struct {
	Fname string
	Hour  bool
	// contains filtered or unexported fields
}

func InitLoggingConsumer

func InitLoggingConsumer(fname string, hour bool) (*LoggingConsumer, error)

func (*LoggingConsumer) Close

func (c *LoggingConsumer) Close() error

func (*LoggingConsumer) Flush

func (c *LoggingConsumer) Flush() error

func (*LoggingConsumer) ItemSend

func (c *LoggingConsumer) ItemSend(item structs.Item) error

func (*LoggingConsumer) Send

func (c *LoggingConsumer) Send(data structs.EventData) error

Jump to

Keyboard shortcuts

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