bufmodulestore

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitStore

type CommitStore interface {
	// GetCommitsForModuleKeys gets the Commits from the store for the ModuleKeys.
	//
	// Returns the found Commits, and the input IDs that were not found, each
	// ordered by the order of the input IDs.
	GetCommitsForModuleKeys(ctx context.Context, moduleKeys []bufmodule.ModuleKey) (
		foundCommits []bufmodule.Commit,
		notFoundModuleKeys []bufmodule.ModuleKey,
		err error,
	)
	// GetCommitsForCommitKeys gets the Commits from the store for the CommitKeys.
	//
	// Returns the found Commits, and the input IDs that were not found, each
	// ordered by the order of the input IDs.
	GetCommitsForCommitKeys(ctx context.Context, commitKeys []bufmodule.CommitKey) (
		foundCommits []bufmodule.Commit,
		notFoundCommitKeys []bufmodule.CommitKey,
		err error,
	)
	// Put puts the Commits to the store.
	PutCommits(ctx context.Context, commits []bufmodule.Commit) error
}

CommitStore reads and writes Commits.

func NewCommitStore

func NewCommitStore(
	logger *zap.Logger,
	bucket storage.ReadWriteBucket,
) CommitStore

NewCommitStore returns a new CommitStore for the given bucket.

It is assumed that the CommitStore has complete control of the bucket.

This is typically used to interact with a cache directory.

type ModuleDataStore

type ModuleDataStore interface {
	// GetModuleDatasForModuleKey gets the ModuleDatas from the store for the ModuleKeys.
	//
	// Returns the found ModuleDatas, and the input ModuleKeys that were not found, each
	// ordered by the order of the input ModuleKeys.
	GetModuleDatasForModuleKeys(context.Context, []bufmodule.ModuleKey) (
		foundModuleDatas []bufmodule.ModuleData,
		notFoundModuleKeys []bufmodule.ModuleKey,
		err error,
	)

	// Put puts the ModuleDatas to the store.
	PutModuleDatas(ctx context.Context, moduleDatas []bufmodule.ModuleData) error
}

ModuleStore reads and writes ModulesDatas.

func NewModuleDataStore

func NewModuleDataStore(
	logger *zap.Logger,
	bucket storage.ReadWriteBucket,
	options ...ModuleDataStoreOption,
) ModuleDataStore

NewModuleDataStore returns a new ModuleDataStore for the given bucket.

It is assumed that the ModuleDataStore has complete control of the bucket.

This is typically used to interact with a cache directory.

type ModuleDataStoreOption

type ModuleDataStoreOption func(*moduleDataStore)

ModuleDataStoreOption is an option for a new ModuleDataStore.

func ModuleDataStoreWithTar

func ModuleDataStoreWithTar() ModuleDataStoreOption

ModuleDataStoreWithTar returns a new ModuleDataStoreOption that reads and stores tar files instead of storing individual files in a directory in the bucket.

The default is to store individual files in a directory.

type ModuleDatasResult

type ModuleDatasResult interface {
	// FoundModuleDatas is the ModuleDatas that were found.
	//
	// Ordered by the order of input ModuleKeys.
	FoundModuleDatas() []bufmodule.ModuleData
	// NotFoundModuleKeys is the input ModuleKeys that were not found.
	//
	// Ordered by the order of input ModuleKeys.
	NotFoundModuleKeys() []bufmodule.ModuleKey
	// contains filtered or unexported methods
}

ModuleDatasResult is a result for a get of ModuleDatas.

Jump to

Keyboard shortcuts

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