Documentation
¶
Index ¶
- func NewServer(provider Provider) remoteexecution.CapabilitiesServer
- type Provider
- func NewActionCacheUpdateEnabledClearingProvider(base Provider, authorizer auth.Authorizer) Provider
- func NewAuthorizingProvider(base Provider, authorizer auth.Authorizer) Provider
- func NewMergingProvider(providers []Provider) Provider
- func NewStaticProvider(capabilities *remoteexecution.ServerCapabilities) Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(provider Provider) remoteexecution.CapabilitiesServer
NewServer creates a gRPC server object for the REv2 Capabilities service.
Types ¶
type Provider ¶
type Provider interface {
GetCapabilities(ctx context.Context, instanceName digest.InstanceName) (*remoteexecution.ServerCapabilities, error)
}
Provider of capabilities.
This interface is implemented for objects like BlobAccess and BuildQueue to report parts of REv2 ServerCapabilities messages. Each type is responsible for only reporting the fields that apply that subsystem. For example, BlobAccess will report CacheCapabilities, while BuildQueue will report ExecutionCapabilities. The messages returned by each subsystem can be merged into a complete message that can be returned to clients.
All implementations of Provider must make sure that if GetCapabilities() succeeds, either CacheCapabilities or ExecutionCapabilities is set. The REv2 spec doesn't describe the case where both are unset.
func NewActionCacheUpdateEnabledClearingProvider ¶
func NewActionCacheUpdateEnabledClearingProvider(base Provider, authorizer auth.Authorizer) Provider
NewActionCacheUpdateEnabledClearingProvider creates a decorator for a capabilities provider that clears the ActionCacheUpdateCapabilities.update_enabled field based on an authorization decision. This can be used to report to clients that an Action Cache is only available for reading; not for writing.
func NewAuthorizingProvider ¶
func NewAuthorizingProvider(base Provider, authorizer auth.Authorizer) Provider
NewAuthorizingProvider creates a decorator for Provider that only performs GetCapabilities() calls in case a client is authorized.
func NewMergingProvider ¶
NewMergingProvider creates a capabilities provider that merges the capabilities reported by multiple backends. It can, for example, be used by frontend processes to merge the capabilities reported by separate storage cluster and scheduler.
This implementation assumes that backends report non-overlapping capabilities.
func NewStaticProvider ¶
func NewStaticProvider(capabilities *remoteexecution.ServerCapabilities) Provider
NewStaticProvider creates a capabilities provider that returns a fixed response. This can be used by individual subsystems to declare base providers that report capabilities of features they implement.