sender

package
v0.0.0-...-63e5ba4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDefault = Config{
	UseMemoryFallback:  true,
	FileWorkspace:      "/tmp",
	FleMaxCaraptedFile: 1,
	ShowSuccessfulInfo: false,
	SendInterval:       10 * time.Second,
	SendLimit:          1000,
}

ConfigDefault is the default config

Functions

func NewPool

func NewPool(newQueue NewQueueFunc) ballistic.Pool

Types

type Config

type Config struct {
	Logger             Logger
	SendInterval       time.Duration
	SendLimit          int
	UseMemoryFallback  bool
	FileWorkspace      string
	FleMaxCaraptedFile int
	ShowSuccessfulInfo bool
}

Config defines the config for file queue.

type Logger

type Logger interface {
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
}

func NewStdLogger

func NewStdLogger() (Logger, error)

type NewQueueFunc

type NewQueueFunc = func(model ballistic.DataModel) (ballistic.Queue, error)

type Pool

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

func (*Pool) Append

func (p *Pool) Append(models []ballistic.DataModel) error

func (*Pool) Eject

func (p *Pool) Eject(limit int) (models []ballistic.DataModel, err error)

func (*Pool) Push

func (p *Pool) Push(model ballistic.DataModel) (err error)

type Sender

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

func NewSender

func NewSender(connect *sql.DB, config ...Config) *Sender

func (*Sender) Push

func (s *Sender) Push(model ballistic.DataModel) error

func (*Sender) RunPusher

func (s *Sender) RunPusher(ctx context.Context)

func (*Sender) Stop

func (s *Sender) Stop(sendTail bool)

Jump to

Keyboard shortcuts

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