storage

package
v0.0.0-...-4926e8e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyDigest = &remoteexecution.Digest{
	Hash:      "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
	SizeBytes: 0,
}

EmptyDigest is a REv2 Digest representing an object of size 0 hashed with SHA256

Functions

func NewAsset

func NewAsset(digest *remoteexecution.Digest, assetType asset.Asset_AssetType, expireAt *timestamppb.Timestamp) *asset.Asset

NewAsset creates a new Asset from request data.

func NewAssetReference

func NewAssetReference(uris []string, qualifiers []*remoteasset.Qualifier) *asset.AssetReference

NewAssetReference creates a new AssetReference from a URI and a list of qualifiers. Mainly this is a wrapper to ensure the qualifiers get sorted

func NewBlobAsset

func NewBlobAsset(digest *remoteexecution.Digest, expireAt *timestamppb.Timestamp) *asset.Asset

NewBlobAsset creates a new Asset (type Blob) from request data.

func NewDirectoryAsset

func NewDirectoryAsset(digest *remoteexecution.Digest, expireAt *timestamppb.Timestamp) *asset.Asset

NewDirectoryAsset creates a new Asset (type Directory) from request data.

func ProtoSerialise

func ProtoSerialise(pb proto.Message) ([]byte, *remoteexecution.Digest, error)

ProtoSerialise serialises an arbitrary protobuf message into its wire format and a Remote Execution API Digest of the format. This is very useful for interacting with the Remote Execution API

func ProtoToDigest

func ProtoToDigest(pb proto.Message, instance digest.InstanceName) (digest.Digest, error)

ProtoToDigest converts an arbitrary protobuf message into a Buildbarn-internal Digest of its content.

Types

type AssetStore

type AssetStore interface {
	Get(ctx context.Context, ref *asset.AssetReference, instance digest.InstanceName) (*asset.Asset, error)
	Put(ctx context.Context, ref *asset.AssetReference, data *asset.Asset, instance digest.InstanceName) error
}

AssetStore is a wrapper around a BlobAccess to inteface well with AssetReference messages

func NewActionCacheAssetStore

func NewActionCacheAssetStore(actionCache, contentAddressableStorage blobstore.BlobAccess, maximumMessageSizeBytes int) AssetStore

NewActionCacheAssetStore creates a new AssetStore which stores it's references as ActionResults in the Action Cache.

func NewBlobAccessAssetStore

func NewBlobAccessAssetStore(ba blobstore.BlobAccess, maximumMessageSizeBytes int) AssetStore

NewBlobAccessAssetStore creates a new AssetStore from a BlobAccess

type AuthorizingAssetStore

type AuthorizingAssetStore struct {
	AssetStore
	// contains filtered or unexported fields
}

AuthorizingAssetStore wraps an asset store and validates requests against the authorizers

func NewAuthorizingAssetStore

func NewAuthorizingAssetStore(as AssetStore, fetchAuthorizer, pushAuthorizer auth.Authorizer) *AuthorizingAssetStore

NewAuthorizingAssetStore creates a new authorizing asset store

func (*AuthorizingAssetStore) Get

Get is a wrapper that validates credentials against FetchAuthorizer

func (*AuthorizingAssetStore) Put

func (aas *AuthorizingAssetStore) Put(ctx context.Context, ref *asset.AssetReference, data *asset.Asset, instanceName digest.InstanceName) error

Put is a wrapper that validates credentials against PushAuthorizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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