objtest

package
v3.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package objtest provides support for creating a data object storage directory for testing purposes.

Index

Constants

View Source
const Tenant = "objtest"

Tenant is the tenant used for storing logs with a Builder.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is a directory holding logs data objects and index data objects. Logs can be appended to the builder using Builder.Append. After all logs have been appended, the builder must be closed using the Builder.Close.

func NewBuilder

func NewBuilder(t *testing.T) *Builder

NewBuilder creates a builder that can be used for accumulating logs.

func (*Builder) Append

func (b *Builder) Append(ctx context.Context, streams ...logproto.Stream)

Append appends the given streams to the builder.

func (*Builder) Close

func (b *Builder) Close()

Close flushes all remaining data and closes the builder.

func (*Builder) Location

func (b *Builder) Location() Location

Location returns the location of index for b so they can be read. Data is not guaranteed to exist in the location until calling Builder.Close.

type Location

type Location struct {
	Bucket      objstore.Bucket // Bucket where all data is stored.
	IndexPrefix string          // Prefix for index objects in the Bucket.
}

Location holds information about where objects for a Builder are stored. Location can be used to read data from a builder.

Jump to

Keyboard shortcuts

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