Documentation
¶
Index ¶
- func TranslateDirectory(dir *repb.Directory, idStore IdentityStore, currentDigest digest.Digest, ...) ([]byte, []remote.BundledObject, error)
- type BadgerIdentityStore
- type IdentityEntry
- type IdentityStore
- type RBEClient
- func (c *RBEClient) AddMapResult(ctx context.Context, from, to entities.Hash) error
- func (c *RBEClient) Close() error
- func (c *RBEClient) GetObject(ctx context.Context, key entities.Hash) (remote.ContentReadCloser, error)
- func (c *RBEClient) GetRefs(ctx context.Context, server string, project string, refs []string) ([]entities.Hash, error)
- func (c *RBEClient) Headers(ctx context.Context, keys []entities.Hash) ([]entities.ObjectHeader, error)
- func (c *RBEClient) MapResults(ctx context.Context, from entities.Hash) ([]entities.Hash, error)
- func (c *RBEClient) Mark(ctx context.Context, hash entities.Hash, key, value string) (int64, error)
- func (c *RBEClient) PutObject(ctx context.Context, key entities.Hash, reader remote.ContentReadCloser) error
- func (c *RBEClient) PutRefs(ctx context.Context, server string, project string, refs []entities.RefHash) error
- func (c *RBEClient) SHA256(ctx context.Context, keys []entities.Hash) ([]entities.SHA256, error)
- func (c *RBEClient) SearchRefs(ctx context.Context, server string, project string, refPrefix string, ...) ([]entities.ProjectRefHash, error)
- func (c *RBEClient) Version(ctx context.Context) (string, error)
- func (c *RBEClient) WhoAmI(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TranslateDirectory ¶
func TranslateDirectory(dir *repb.Directory, idStore IdentityStore, currentDigest digest.Digest, gitlinks map[digest.Digest]entities.Hash, sha1Map map[digest.Digest]entities.Hash) ([]byte, []remote.BundledObject, error)
TranslateDirectory converts an RBE Directory proto into ABFS tree bytes, primes the IdentityStore with mappings for all children and returns a list of "bundled" blobs (like symlink targets).
Types ¶
type BadgerIdentityStore ¶
type BadgerIdentityStore struct {
// contains filtered or unexported fields
}
func NewBadgerIdentityStore ¶
func NewBadgerIdentityStore(path string) (*BadgerIdentityStore, error)
NewBadgerIdentityStore creates and opens a new IdentityStore backed by BadgerDB.
func (*BadgerIdentityStore) Close ¶
func (s *BadgerIdentityStore) Close() error
Close closes the underlying BadgerDB instance.
func (*BadgerIdentityStore) PutMany ¶
func (s *BadgerIdentityStore) PutMany(entries []IdentityEntry) error
PutMany records multiple mappings from SHA-1 hashes to RBE nodes using WriteBatch.
type IdentityEntry ¶
IdentityEntry represents a single mapping between a SHA-1 hash and an RBE node.
func TranslateDirectoryEntries ¶
func TranslateDirectoryEntries(dir *repb.Directory, currentDigest digest.Digest, gitlinks map[digest.Digest]entities.Hash, sha1Map map[digest.Digest]entities.Hash) ([]byte, []remote.BundledObject, []IdentityEntry, error)
TranslateDirectoryEntries converts an RBE Directory proto into ABFS tree bytes, extracts identity store mapping entries without writing to the store directly, and returns a list of "bundled" blobs (like symlink targets).
type IdentityStore ¶
type IdentityStore interface {
// Put records a mapping from a SHA-1 hash to an RBE node (digest + type).
Put(sha1 entities.Hash, node model.Node) error
// PutMany records multiple mappings from SHA-1 hashes to RBE nodes in batches.
PutMany(entries []IdentityEntry) error
// Get retrieves the RBE node associated with a SHA-1 hash.
// Returns (node, true, nil) if found, (empty, false, nil) if not found.
Get(sha1 entities.Hash) (model.Node, bool, error)
// Close closes the underlying storage.
Close() error
}
IdentityStore provides a shared mapping layer between ABFS SHA-1 hashes and RBE digests (SHA-256 + Size).
type RBEClient ¶
type RBEClient struct {
// contains filtered or unexported fields
}
RBEClient implements the remote.RemoteProvider interface using an RBE backend. It uses an IdentityStore to map ABFS SHA-1 hashes to RBE SHA-256 digests.
func NewRBEClient ¶
func NewRBEClient(rbeClient *rexec.Client, idStore IdentityStore) *RBEClient
NewRBEClient creates a new RBEClient.
func (*RBEClient) AddMapResult ¶
AddMapResult delegates to fallback.
func (*RBEClient) GetObject ¶
func (c *RBEClient) GetObject(ctx context.Context, key entities.Hash) (remote.ContentReadCloser, error)
GetObject fulfills a SHA-1 request by resolving it via the IdentityStore and fetching from RBE.
func (*RBEClient) GetRefs ¶
func (c *RBEClient) GetRefs(ctx context.Context, server string, project string, refs []string) ([]entities.Hash, error)
GetRefs delegates to fallback.
func (*RBEClient) Headers ¶
func (c *RBEClient) Headers(ctx context.Context, keys []entities.Hash) ([]entities.ObjectHeader, error)
Headers returns metadata for the provided keys by resolving them via the IdentityStore.
func (*RBEClient) MapResults ¶
MapResults delegates to fallback.
func (*RBEClient) PutObject ¶
func (c *RBEClient) PutObject(ctx context.Context, key entities.Hash, reader remote.ContentReadCloser) error
PutObject uploads an object to RBE and records the SHA-1 -> SHA-256 mapping.
func (*RBEClient) PutRefs ¶
func (c *RBEClient) PutRefs(ctx context.Context, server string, project string, refs []entities.RefHash) error
PutRefs delegates to fallback.
func (*RBEClient) SearchRefs ¶
func (c *RBEClient) SearchRefs(ctx context.Context, server string, project string, refPrefix string, limit int) ([]entities.ProjectRefHash, error)
SearchRefs delegates to fallback.