persist

package
v0.0.0-...-59a1c40 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeFileOpen  = 100
	ErrCodeFileWrite = 101
)

Variables

This section is empty.

Functions

func AddStats

func AddStats(m map[string]string)

AddStats fills stats keys that correspond to persistent storage

func FlushAcknowlegedOffsetsMap

func FlushAcknowlegedOffsetsMap() error

FlushAcknowlegedOffsetsMap saves current offsets map. It is made public so that offsets can be saved right before SIGTERM.

func Heartbeat

func Heartbeat(buildVersion, buildCommit string, configTs int32, configHash string, memoryUsedBytes uint64, cpuUserAvg, cpuSysAvg float32)

Heartbeat adds entry to daemon_heartbeat_buffer table.

func Init

func Init(c Config)

Init initializes config variables and checks that configuration is valid.

func InternalLog

func InternalLog(typ, table string, volume int64, message, content string)

InternalLog adds entry to internal log table. Be careful to avoid infinite recursion when using inside of persist package itself.

func UpdateDestinationsConfig

func UpdateDestinationsConfig(m destination.Map)

UpdateDestinationsConfig accepts destination.Map and restarts all senders

func Write

func Write(table string, data []byte, rowBinary bool) error

Write writes to per-table on-disk log and returns after data was put into filesystem.

Types

type Config

type Config struct {
	Dir            string
	Port           uint // for debug purposes
	MaxSendSize    int64
	MaxFileSize    int64
	RotateInterval time.Duration
	MarkAsDone     bool // rename files to ".done" instead of deleting files that are delivered successfully
	// contains filtered or unexported fields
}

Config for package

Jump to

Keyboard shortcuts

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