consumers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: 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

	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) 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) Send

type Consumer

type Consumer interface {
	Send(data structs.EventData) error
	Flush() error
	Close() 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) 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) 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) 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