bufmoduleapi

package
v1.32.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestForCommitID

func DigestForCommitID(
	ctx context.Context,
	clientProvider interface {
		bufapi.V1CommitServiceClientProvider
		bufapi.V1Beta1CommitServiceClientProvider
	},
	registry string,
	commitID uuid.UUID,
	digestType bufmodule.DigestType,
) (bufmodule.Digest, error)

DigestForCommitID resolves the commit ID by calling the CommitService to get the Digest for the Commit.

func DigestToV1Beta1Proto

func DigestToV1Beta1Proto(digest bufmodule.Digest) (*modulev1beta1.Digest, error)

DigestToV1Beta1Proto converts the given Digest to a proto Digest.

func DigestToV1Proto

func DigestToV1Proto(digest bufmodule.Digest) (*modulev1.Digest, error)

DigestToV1Proto converts the given Digest to a proto Digest.

func NewCommitProvider

NewCommitProvider returns a new CommitProvider for the given API client.

func NewGraphProvider

NewGraphProvider returns a new GraphProvider for the given API client.

func NewModuleDataProvider

NewModuleDataProvider returns a new ModuleDataProvider for the given API client.

A warning is printed to the logger if a given Module is deprecated.

func NewModuleKeyProvider

func NewModuleKeyProvider(
	logger *zap.Logger,
	clientProvider interface {
		bufapi.V1CommitServiceClientProvider
		bufapi.V1Beta1CommitServiceClientProvider
	},
) bufmodule.ModuleKeyProvider

NewModuleKeyProvider returns a new ModuleKeyProvider for the given API clients.

func NewUploader

NewUploader returns a new Uploader for the given API client.

func V1Beta1ProtoToDigest

func V1Beta1ProtoToDigest(protoDigest *modulev1beta1.Digest) (bufmodule.Digest, error)

V1Beta1ProtoToDigest converts the given proto Digest to a Digest.

Validation is performed to ensure the DigestType is known, and the value is a valid digest value for the given DigestType.

func V1ProtoToDigest

func V1ProtoToDigest(protoDigest *modulev1.Digest) (bufmodule.Digest, error)

V1ProtoToDigest converts the given proto Digest to a Digest.

Validation is performed to ensure the DigestType is known, and the value is a valid digest value for the given DigestType.

Types

type GraphProviderOption

type GraphProviderOption func(*graphProvider)

GraphProviderOption is an option for a new GraphProvider.

func GraphProviderWithLegacyFederationRegistry

func GraphProviderWithLegacyFederationRegistry(legacyFederationRegistry string) GraphProviderOption

GraphProviderWithLegacyFederationRegistry returns a new GraphProviderOption that specifies the hostname of an additional registry that is allowed to use legacy federation. This should only be used in testing.

func GraphProviderWithPublicRegistry

func GraphProviderWithPublicRegistry(publicRegistry string) GraphProviderOption

GraphProviderWithPublicRegistry returns a new GraphProviderOption that specifies the hostname of the public registry. By default this is "buf.build", however in testing, this may be something else. This is needed to discern which which registry to make calls against in the case where there is >1 registries represented in the ModuleKeys - we always want to call the non-public registry.

type UploaderOption

type UploaderOption func(*uploader)

UploaderOption is an option for a new Uploader.

func UploaderWithPublicRegistry

func UploaderWithPublicRegistry(publicRegistry string) UploaderOption

UploaderWithPublicRegistry returns a new UploaderOption that specifies the hostname of the public registry. By default this is "buf.build", however in testing, this may be something else. This is needed to discern which which registry to make calls against in the case where there is >1 registries represented in the ModuleKeys - we always want to call the non-public registry.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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