dirpartition

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MonthPartitionProvider

type MonthPartitionProvider struct {
	TimeFn TimeExtractor
}

MonthPartitionProvider decides directories yyyyMM from TimeExtractor.

func (*MonthPartitionProvider) GetPartitionDir

func (p *MonthPartitionProvider) GetPartitionDir(key mapstore.FileKey) (string, error)

GetPartitionDir implements the PartitionProvider interface.

func (*MonthPartitionProvider) ListPartitions

func (p *MonthPartitionProvider) ListPartitions(
	baseDir string,
	sortOrder string,
	pageToken string,
	pageSize int,
) (partitions []string, nextPageToken string, err error)

ListPartitions returns a paginated and sorted list of partition directories in the base directory.

type NoPartitionProvider

type NoPartitionProvider struct{}

NoPartitionProvider is a default implementation that treats the base directory as a single partition.

func (*NoPartitionProvider) GetPartitionDir

func (p *NoPartitionProvider) GetPartitionDir(_ mapstore.FileKey) (string, error)

GetPartitionDir returns an empty string, indicating no partitioning.

func (*NoPartitionProvider) ListPartitions

func (p *NoPartitionProvider) ListPartitions(
	baseDir string,
	sortOrder string,
	pageToken string,
	pageSize int,
) (partitions []string, nextPageToken string, err error)

ListPartitions returns a single partition representing the base directory.

type TimeExtractor

type TimeExtractor func(key mapstore.FileKey) (time.Time, error)

TimeExtractor is a function that returns the creation time of a file.

Jump to

Keyboard shortcuts

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