assetv1grpc

package
v1.6.0-20230602030542-... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Fetch_FetchBlob_FullMethodName      = "/build.bazel.remote.asset.v1.Fetch/FetchBlob"
	Fetch_FetchDirectory_FullMethodName = "/build.bazel.remote.asset.v1.Fetch/FetchDirectory"
)
View Source
const (
	Push_PushBlob_FullMethodName      = "/build.bazel.remote.asset.v1.Push/PushBlob"
	Push_PushDirectory_FullMethodName = "/build.bazel.remote.asset.v1.Push/PushDirectory"
)

Variables

View Source
var Fetch_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "build.bazel.remote.asset.v1.Fetch",
	HandlerType: (*FetchServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FetchBlob",
			Handler:    _Fetch_FetchBlob_Handler,
		},
		{
			MethodName: "FetchDirectory",
			Handler:    _Fetch_FetchDirectory_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "build/bazel/remote/asset/v1/remote_asset.proto",
}

Fetch_ServiceDesc is the grpc.ServiceDesc for Fetch service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Push_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "build.bazel.remote.asset.v1.Push",
	HandlerType: (*PushServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PushBlob",
			Handler:    _Push_PushBlob_Handler,
		},
		{
			MethodName: "PushDirectory",
			Handler:    _Push_PushDirectory_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "build/bazel/remote/asset/v1/remote_asset.proto",
}

Push_ServiceDesc is the grpc.ServiceDesc for Push service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterFetchServer

func RegisterFetchServer(s grpc.ServiceRegistrar, srv FetchServer)

func RegisterPushServer

func RegisterPushServer(s grpc.ServiceRegistrar, srv PushServer)

Types

type FetchClient

type FetchClient interface {
	// Resolve or fetch referenced assets, making them available to the caller and
	// other consumers in the [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
	//
	// Servers *MAY* fetch content that they do not already have cached, for any
	// URLs they support.
	//
	// Servers *SHOULD* ensure that referenced files are present in the CAS at the
	// time of the response, and (if supported) that they will remain available
	// for a reasonable period of time. The lifetimes of the referenced blobs *SHOULD*
	// be increased if necessary and applicable.
	// In the event that a client receives a reference to content that is no
	// longer present, it *MAY* re-issue the request with
	// `oldest_content_accepted` set to a more recent timestamp than the original
	// attempt, to induce a re-fetch from origin.
	//
	// Servers *MAY* cache fetched content and reuse it for subsequent requests,
	// subject to `oldest_content_accepted`.
	//
	// Servers *MAY* support the complementary [Push][build.bazel.remote.asset.v1.Push]
	// API and allow content to be directly inserted for use in future fetch
	// responses.
	//
	// Servers *MUST* ensure Fetch'd content matches all the specified
	// qualifiers except in the case of previously Push'd resources, for which
	// the server *MAY* trust the pushing client to have set the qualifiers
	// correctly, without validation.
	//
	// Servers not implementing the complementary [Push][build.bazel.remote.asset.v1.Push]
	// API *MUST* reject requests containing qualifiers it does not support.
	//
	// Servers *MAY* transform assets as part of the fetch. For example a
	// tarball fetched by [FetchDirectory][build.bazel.remote.asset.v1.Fetch.FetchDirectory]
	// might be unpacked, or a Git repository
	// fetched by [FetchBlob][build.bazel.remote.asset.v1.Fetch.FetchBlob]
	// might be passed through `git-archive`.
	//
	// Errors handling the requested assets will be returned as gRPC Status errors
	// here; errors outside the server's control will be returned inline in the
	// `status` field of the response (see comment there for details).
	// The possible RPC errors include:
	//   - `INVALID_ARGUMENT`: One or more arguments were invalid, such as a
	//     qualifier that is not supported by the server.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
	//     perform the requested operation. The client may retry after a delay.
	//   - `UNAVAILABLE`: Due to a transient condition the operation could not be
	//     completed. The client should retry.
	//   - `INTERNAL`: An internal error occurred while performing the operation.
	//     The client should retry.
	//   - `DEADLINE_EXCEEDED`: The fetch could not be completed within the given
	//     RPC deadline. The client should retry for at least as long as the value
	//     provided in `timeout` field of the request.
	//
	// In the case of unsupported qualifiers, the server *SHOULD* additionally
	// send a [BadRequest][google.rpc.BadRequest] error detail where, for each
	// unsupported qualifier, there is a `FieldViolation` with a `field` of
	// `qualifiers.name` and a `description` of `"{qualifier}" not supported`
	// indicating the name of the unsupported qualifier.
	FetchBlob(ctx context.Context, in *v1.FetchBlobRequest, opts ...grpc.CallOption) (*v1.FetchBlobResponse, error)
	FetchDirectory(ctx context.Context, in *v1.FetchDirectoryRequest, opts ...grpc.CallOption) (*v1.FetchDirectoryResponse, error)
}

FetchClient is the client API for Fetch service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

The Fetch service resolves or fetches assets referenced by URI and Qualifiers, returning a Digest for the content in [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided.

func NewFetchClient

func NewFetchClient(cc grpc.ClientConnInterface) FetchClient

type FetchServer

type FetchServer interface {
	// Resolve or fetch referenced assets, making them available to the caller and
	// other consumers in the [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
	//
	// Servers *MAY* fetch content that they do not already have cached, for any
	// URLs they support.
	//
	// Servers *SHOULD* ensure that referenced files are present in the CAS at the
	// time of the response, and (if supported) that they will remain available
	// for a reasonable period of time. The lifetimes of the referenced blobs *SHOULD*
	// be increased if necessary and applicable.
	// In the event that a client receives a reference to content that is no
	// longer present, it *MAY* re-issue the request with
	// `oldest_content_accepted` set to a more recent timestamp than the original
	// attempt, to induce a re-fetch from origin.
	//
	// Servers *MAY* cache fetched content and reuse it for subsequent requests,
	// subject to `oldest_content_accepted`.
	//
	// Servers *MAY* support the complementary [Push][build.bazel.remote.asset.v1.Push]
	// API and allow content to be directly inserted for use in future fetch
	// responses.
	//
	// Servers *MUST* ensure Fetch'd content matches all the specified
	// qualifiers except in the case of previously Push'd resources, for which
	// the server *MAY* trust the pushing client to have set the qualifiers
	// correctly, without validation.
	//
	// Servers not implementing the complementary [Push][build.bazel.remote.asset.v1.Push]
	// API *MUST* reject requests containing qualifiers it does not support.
	//
	// Servers *MAY* transform assets as part of the fetch. For example a
	// tarball fetched by [FetchDirectory][build.bazel.remote.asset.v1.Fetch.FetchDirectory]
	// might be unpacked, or a Git repository
	// fetched by [FetchBlob][build.bazel.remote.asset.v1.Fetch.FetchBlob]
	// might be passed through `git-archive`.
	//
	// Errors handling the requested assets will be returned as gRPC Status errors
	// here; errors outside the server's control will be returned inline in the
	// `status` field of the response (see comment there for details).
	// The possible RPC errors include:
	//   - `INVALID_ARGUMENT`: One or more arguments were invalid, such as a
	//     qualifier that is not supported by the server.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
	//     perform the requested operation. The client may retry after a delay.
	//   - `UNAVAILABLE`: Due to a transient condition the operation could not be
	//     completed. The client should retry.
	//   - `INTERNAL`: An internal error occurred while performing the operation.
	//     The client should retry.
	//   - `DEADLINE_EXCEEDED`: The fetch could not be completed within the given
	//     RPC deadline. The client should retry for at least as long as the value
	//     provided in `timeout` field of the request.
	//
	// In the case of unsupported qualifiers, the server *SHOULD* additionally
	// send a [BadRequest][google.rpc.BadRequest] error detail where, for each
	// unsupported qualifier, there is a `FieldViolation` with a `field` of
	// `qualifiers.name` and a `description` of `"{qualifier}" not supported`
	// indicating the name of the unsupported qualifier.
	FetchBlob(context.Context, *v1.FetchBlobRequest) (*v1.FetchBlobResponse, error)
	FetchDirectory(context.Context, *v1.FetchDirectoryRequest) (*v1.FetchDirectoryResponse, error)
}

FetchServer is the server API for Fetch service. All implementations should embed UnimplementedFetchServer for forward compatibility.

The Fetch service resolves or fetches assets referenced by URI and Qualifiers, returning a Digest for the content in [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided.

type PushClient

type PushClient interface {
	// These APIs associate the identifying information of a resource, as
	// indicated by URI and optionally Qualifiers, with content available in the
	// CAS. For example, associating a repository url and a commit id with a
	// Directory Digest.
	//
	// Servers *SHOULD* only allow trusted clients to associate content, and *MAY*
	// only allow certain URIs to be pushed.
	//
	// Clients *MUST* ensure associated content is available in CAS prior to
	// pushing.
	//
	// Clients *MUST* ensure the Qualifiers listed correctly match the contents,
	// and Servers *MAY* trust these values without validation.
	// Fetch servers *MAY* require exact match of all qualifiers when returning
	// content previously pushed, or allow fetching content with only a subset of
	// the qualifiers specified on Push.
	//
	// Clients can specify expiration information that the server *SHOULD*
	// respect. Subsequent requests can be used to alter the expiration time.
	//
	// A minimal compliant Fetch implementation may support only Push'd content
	// and return `NOT_FOUND` for any resource that was not pushed first.
	// Alternatively, a compliant implementation may choose to not support Push
	// and only return resources that can be Fetch'd from origin.
	//
	// Errors will be returned as gRPC Status errors.
	// The possible RPC errors include:
	//   - `INVALID_ARGUMENT`: One or more arguments to the RPC were invalid.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
	//     perform the requested operation. The client may retry after a delay.
	//   - `UNAVAILABLE`: Due to a transient condition the operation could not be
	//     completed. The client should retry.
	//   - `INTERNAL`: An internal error occurred while performing the operation.
	//     The client should retry.
	PushBlob(ctx context.Context, in *v1.PushBlobRequest, opts ...grpc.CallOption) (*v1.PushBlobResponse, error)
	PushDirectory(ctx context.Context, in *v1.PushDirectoryRequest, opts ...grpc.CallOption) (*v1.PushDirectoryResponse, error)
}

PushClient is the client API for Push service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

The Push service is complementary to the Fetch, and allows for associating contents of URLs to be returned in future Fetch API calls.

As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided.

func NewPushClient

func NewPushClient(cc grpc.ClientConnInterface) PushClient

type PushServer

type PushServer interface {
	// These APIs associate the identifying information of a resource, as
	// indicated by URI and optionally Qualifiers, with content available in the
	// CAS. For example, associating a repository url and a commit id with a
	// Directory Digest.
	//
	// Servers *SHOULD* only allow trusted clients to associate content, and *MAY*
	// only allow certain URIs to be pushed.
	//
	// Clients *MUST* ensure associated content is available in CAS prior to
	// pushing.
	//
	// Clients *MUST* ensure the Qualifiers listed correctly match the contents,
	// and Servers *MAY* trust these values without validation.
	// Fetch servers *MAY* require exact match of all qualifiers when returning
	// content previously pushed, or allow fetching content with only a subset of
	// the qualifiers specified on Push.
	//
	// Clients can specify expiration information that the server *SHOULD*
	// respect. Subsequent requests can be used to alter the expiration time.
	//
	// A minimal compliant Fetch implementation may support only Push'd content
	// and return `NOT_FOUND` for any resource that was not pushed first.
	// Alternatively, a compliant implementation may choose to not support Push
	// and only return resources that can be Fetch'd from origin.
	//
	// Errors will be returned as gRPC Status errors.
	// The possible RPC errors include:
	//   - `INVALID_ARGUMENT`: One or more arguments to the RPC were invalid.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
	//     perform the requested operation. The client may retry after a delay.
	//   - `UNAVAILABLE`: Due to a transient condition the operation could not be
	//     completed. The client should retry.
	//   - `INTERNAL`: An internal error occurred while performing the operation.
	//     The client should retry.
	PushBlob(context.Context, *v1.PushBlobRequest) (*v1.PushBlobResponse, error)
	PushDirectory(context.Context, *v1.PushDirectoryRequest) (*v1.PushDirectoryResponse, error)
}

PushServer is the server API for Push service. All implementations should embed UnimplementedPushServer for forward compatibility.

The Push service is complementary to the Fetch, and allows for associating contents of URLs to be returned in future Fetch API calls.

As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided.

type UnimplementedFetchServer

type UnimplementedFetchServer struct{}

UnimplementedFetchServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedFetchServer) FetchBlob

func (UnimplementedFetchServer) FetchDirectory

type UnimplementedPushServer

type UnimplementedPushServer struct{}

UnimplementedPushServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedPushServer) PushBlob

func (UnimplementedPushServer) PushDirectory

type UnsafeFetchServer

type UnsafeFetchServer interface {
	// contains filtered or unexported methods
}

UnsafeFetchServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FetchServer will result in compilation errors.

type UnsafePushServer

type UnsafePushServer interface {
	// contains filtered or unexported methods
}

UnsafePushServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PushServer will result in compilation errors.

Source Files

  • remote_asset_grpc.pb.go

Jump to

Keyboard shortcuts

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