Documentation ¶
Index ¶
- Variables
- func NewAsset(digest *remoteexecution.Digest, assetType asset.Asset_AssetType, ...) *asset.Asset
- func NewAssetReference(uris []string, qualifiers []*remoteasset.Qualifier) *asset.AssetReference
- func NewBlobAsset(digest *remoteexecution.Digest, expireAt *timestamppb.Timestamp) *asset.Asset
- func NewDirectoryAsset(digest *remoteexecution.Digest, expireAt *timestamppb.Timestamp) *asset.Asset
- func ProtoSerialise(pb proto.Message) ([]byte, *remoteexecution.Digest, error)
- func ProtoToDigest(pb proto.Message, instance digest.InstanceName) (digest.Digest, error)
- type AssetStore
- type AuthorizingAssetStore
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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 ¶
func (aas *AuthorizingAssetStore) Get(ctx context.Context, ref *asset.AssetReference, instanceName digest.InstanceName) (*asset.Asset, error)
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