trim

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByAge

func ByAge(ctx context.Context, l klevdb.Log, before time.Time) (map[int64]struct{}, int64, error)

ByAge tries to remove the messages at the start of the log before given time.

returns the offsets it deleted and the amount of storage freed

func ByCount added in v0.2.3

func ByCount(ctx context.Context, l klevdb.Log, max int) (map[int64]struct{}, int64, error)

ByCount tries to remove messages to keep the number of messages in the log under max count.

returns the offsets it deleted and the amount of storage freed

func ByOffset added in v0.2.5

func ByOffset(ctx context.Context, l klevdb.Log, before int64) (map[int64]struct{}, int64, error)

ByOffset tries to remove the messages at the start of the log before offset

returns the offsets it deleted and the amount of storage freed

func BySize

func BySize(ctx context.Context, l klevdb.Log, sz int64) (map[int64]struct{}, int64, error)

BySize tries to remove messages until log size is less then sz

returns the offsets it deleted and the amount of storage freed

func FindByAge added in v0.3.0

func FindByAge(ctx context.Context, l klevdb.Log, before time.Time) (map[int64]struct{}, error)

FindByAge returns a set of offsets for messages that are at the start of the log and before given time.

func FindByCount added in v0.3.0

func FindByCount(ctx context.Context, l klevdb.Log, max int) (map[int64]struct{}, error)

FindByCount returns a set of offsets for messages that when removed will keep number of the messages in the log less then max

func FindByOffset added in v0.3.0

func FindByOffset(ctx context.Context, l klevdb.Log, before int64) (map[int64]struct{}, error)

FindByOffset returns a set of offsets for messages that offset is before a given offset

func FindBySize added in v0.3.0

func FindBySize(ctx context.Context, l klevdb.Log, sz int64) (map[int64]struct{}, error)

FindBySize returns a set of offsets for messages that if deleted will decrease the log size to sz

Types

This section is empty.

Jump to

Keyboard shortcuts

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