Documentation ¶
Overview ¶
Package bufmanifest contains helper functions to convert between Protobuf types defined in buf/alpha/registry/v1alpha1/module.proto and the data types in github.com/bufbuild/buf/private/pkg/manifest.
Index ¶
- func AsProtoBlob(ctx context.Context, b manifest.Blob) (_ *modulev1alpha1.Blob, retErr error)
- func NewBlobFromProto(b *modulev1alpha1.Blob) (manifest.Blob, error)
- func NewBlobSetFromProto(ctx context.Context, blobs []*modulev1alpha1.Blob) (*manifest.BlobSet, error)
- func NewDigestFromProtoDigest(digest *modulev1alpha1.Digest) (*manifest.Digest, error)
- func NewManifestFromProto(ctx context.Context, b *modulev1alpha1.Blob) (_ *manifest.Manifest, retErr error)
- func NewReadBucketFromManifestBlobs(ctx context.Context, manifestBlob *modulev1alpha1.Blob, ...) (storage.ReadBucket, error)
- func ToProtoManifestAndBlobs(ctx context.Context, manifest *manifest.Manifest, blobs *manifest.BlobSet) (*modulev1alpha1.Blob, []*modulev1alpha1.Blob, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsProtoBlob ¶
AsProtoBlob converts a manifest.Blob to a Protobuf modulev1alpha1.Blob.
func NewBlobFromProto ¶
func NewBlobFromProto(b *modulev1alpha1.Blob) (manifest.Blob, error)
NewBlobFromProto returns a Blob from a proto module blob. It makes sure the digest and content match.
func NewBlobSetFromProto ¶ added in v1.15.0
func NewBlobSetFromProto(ctx context.Context, blobs []*modulev1alpha1.Blob) (*manifest.BlobSet, error)
NewBlobSetFromProto returns a BlobSet from a slice of proto module blobs. It makes sure the digest and content match for each blob.
func NewDigestFromProtoDigest ¶
func NewDigestFromProtoDigest(digest *modulev1alpha1.Digest) (*manifest.Digest, error)
NewDigestFromProtoDigest converts a modulev1alpha1.Digest to a manifest.Digest.
func NewManifestFromProto ¶ added in v1.15.0
func NewManifestFromProto(ctx context.Context, b *modulev1alpha1.Blob) (_ *manifest.Manifest, retErr error)
NewManifestFromProto returns a Manifest from a proto module blob. It makes sure the digest and content match.
func NewReadBucketFromManifestBlobs ¶ added in v1.24.0
func NewReadBucketFromManifestBlobs( ctx context.Context, manifestBlob *modulev1alpha1.Blob, blobs []*modulev1alpha1.Blob, ) (storage.ReadBucket, error)
NewReadBucketFromManifestBlobs builds a storage bucket from a manifest blob and a set of other blobs, provided in protobuf form. It makes sure that all blobs (including manifest) content match their digest, and additionally checks that the blob set matches completely with the manifest paths (no missing nor extra blobs). This bucket is suitable for building or exporting.
func ToProtoManifestAndBlobs ¶
func ToProtoManifestAndBlobs(ctx context.Context, manifest *manifest.Manifest, blobs *manifest.BlobSet) (*modulev1alpha1.Blob, []*modulev1alpha1.Blob, error)
ToProtoManifestAndBlobs converts a Manifest and BlobSet to the protobuf types.
Types ¶
This section is empty.