upload

package
v0.117.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Upload(ctx context.Context, data []byte) error
}

func NewS3Manager

func NewS3Manager(bucket string, builder *PartitionKeyBuilder, service *s3.Client) Manager

type PartitionKeyBuilder

type PartitionKeyBuilder struct {
	// PartitionPrefix defines the S3 directory (key)
	// prefix used to write the file
	PartitionPrefix string
	// PartitionTruncation is used to truncate values into
	// different time buckets.
	// Currently hourly or minutely is supported
	PartitionTruncation string
	// FilePrefix is used to define the prefix of the file written
	// to the directory in S3.
	FilePrefix string
	// FileFormat defines what encoding was used to write
	// the content to s3
	FileFormat string
	// Metadata provides additional details regarding the file
	// Expected to be one of "metrics", "traces", or "logs"
	Metadata string
	// Compression defines algorithm used on the
	// body before uploaded.
	Compression configcompression.Type
	// UniqueKeyFunc allows for overwritting the default behavior of
	// generating a new unique string to avoid collosions on file upload
	// across many different instances.
	//
	// TODO: Expose the ability to config additional UniqueKeyField via config
	UniqueKeyFunc func() string
}

func (*PartitionKeyBuilder) Build

func (pki *PartitionKeyBuilder) Build(ts time.Time) string

Jump to

Keyboard shortcuts

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