Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type ArtifactInfo
- func (*ArtifactInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ArtifactInfo) GetArchitecture() string
- func (x *ArtifactInfo) GetCreated() *timestamppb.Timestamp
- func (x *ArtifactInfo) GetDockerVersion() string
- func (x *ArtifactInfo) GetHistoryPackages() []*common.Package
- func (x *ArtifactInfo) GetOs() string
- func (x *ArtifactInfo) GetSchemaVersion() int32
- func (*ArtifactInfo) ProtoMessage()
- func (x *ArtifactInfo) ProtoReflect() protoreflect.Message
- func (x *ArtifactInfo) Reset()
- func (x *ArtifactInfo) String() string
- type BlobInfo
- func (*BlobInfo) Descriptor() ([]byte, []int)deprecated
- func (x *BlobInfo) GetApplications() []*common.Application
- func (x *BlobInfo) GetCustomResources() []*common.CustomResource
- func (x *BlobInfo) GetDiffId() string
- func (x *BlobInfo) GetDigest() string
- func (x *BlobInfo) GetMisconfigurations() []*common.Misconfiguration
- func (x *BlobInfo) GetOpaqueDirs() []string
- func (x *BlobInfo) GetOs() *common.OS
- func (x *BlobInfo) GetPackageInfos() []*common.PackageInfo
- func (x *BlobInfo) GetRepository() *common.Repository
- func (x *BlobInfo) GetSchemaVersion() int32
- func (x *BlobInfo) GetSecrets() []*common.Secret
- func (x *BlobInfo) GetWhiteoutFiles() []string
- func (*BlobInfo) ProtoMessage()
- func (x *BlobInfo) ProtoReflect() protoreflect.Message
- func (x *BlobInfo) Reset()
- func (x *BlobInfo) String() string
- type Cache
- type DeleteBlobsRequest
- func (*DeleteBlobsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteBlobsRequest) GetBlobIds() []string
- func (*DeleteBlobsRequest) ProtoMessage()
- func (x *DeleteBlobsRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteBlobsRequest) Reset()
- func (x *DeleteBlobsRequest) String() string
- type HTTPClient
- type MissingBlobsRequest
- func (*MissingBlobsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MissingBlobsRequest) GetArtifactId() string
- func (x *MissingBlobsRequest) GetBlobIds() []string
- func (*MissingBlobsRequest) ProtoMessage()
- func (x *MissingBlobsRequest) ProtoReflect() protoreflect.Message
- func (x *MissingBlobsRequest) Reset()
- func (x *MissingBlobsRequest) String() string
- type MissingBlobsResponse
- func (*MissingBlobsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MissingBlobsResponse) GetMissingArtifact() bool
- func (x *MissingBlobsResponse) GetMissingBlobIds() []string
- func (*MissingBlobsResponse) ProtoMessage()
- func (x *MissingBlobsResponse) ProtoReflect() protoreflect.Message
- func (x *MissingBlobsResponse) Reset()
- func (x *MissingBlobsResponse) String() string
- type PutArtifactRequest
- func (*PutArtifactRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PutArtifactRequest) GetArtifactId() string
- func (x *PutArtifactRequest) GetArtifactInfo() *ArtifactInfo
- func (*PutArtifactRequest) ProtoMessage()
- func (x *PutArtifactRequest) ProtoReflect() protoreflect.Message
- func (x *PutArtifactRequest) Reset()
- func (x *PutArtifactRequest) String() string
- type PutBlobRequest
- func (*PutBlobRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PutBlobRequest) GetBlobInfo() *BlobInfo
- func (x *PutBlobRequest) GetDiffId() string
- func (*PutBlobRequest) ProtoMessage()
- func (x *PutBlobRequest) ProtoReflect() protoreflect.Message
- func (x *PutBlobRequest) Reset()
- func (x *PutBlobRequest) String() string
- type PutResponse
- type TwirpServer
Constants ¶
const CachePathPrefix = "/twirp/trivy.cache.v1.Cache/"
CachePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var File_rpc_cache_service_proto protoreflect.FileDescriptor
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
type ArtifactInfo ¶
type ArtifactInfo struct { SchemaVersion int32 `protobuf:"varint,1,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"` Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"` Created *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"` DockerVersion string `protobuf:"bytes,4,opt,name=docker_version,json=dockerVersion,proto3" json:"docker_version,omitempty"` Os string `protobuf:"bytes,5,opt,name=os,proto3" json:"os,omitempty"` HistoryPackages []*common.Package `protobuf:"bytes,6,rep,name=history_packages,json=historyPackages,proto3" json:"history_packages,omitempty"` // contains filtered or unexported fields }
func (*ArtifactInfo) Descriptor
deprecated
func (*ArtifactInfo) Descriptor() ([]byte, []int)
Deprecated: Use ArtifactInfo.ProtoReflect.Descriptor instead.
func (*ArtifactInfo) GetArchitecture ¶
func (x *ArtifactInfo) GetArchitecture() string
func (*ArtifactInfo) GetCreated ¶
func (x *ArtifactInfo) GetCreated() *timestamppb.Timestamp
func (*ArtifactInfo) GetDockerVersion ¶
func (x *ArtifactInfo) GetDockerVersion() string
func (*ArtifactInfo) GetHistoryPackages ¶
func (x *ArtifactInfo) GetHistoryPackages() []*common.Package
func (*ArtifactInfo) GetOs ¶
func (x *ArtifactInfo) GetOs() string
func (*ArtifactInfo) GetSchemaVersion ¶
func (x *ArtifactInfo) GetSchemaVersion() int32
func (*ArtifactInfo) ProtoMessage ¶
func (*ArtifactInfo) ProtoMessage()
func (*ArtifactInfo) ProtoReflect ¶
func (x *ArtifactInfo) ProtoReflect() protoreflect.Message
func (*ArtifactInfo) Reset ¶
func (x *ArtifactInfo) Reset()
func (*ArtifactInfo) String ¶
func (x *ArtifactInfo) String() string
type BlobInfo ¶
type BlobInfo struct { SchemaVersion int32 `protobuf:"varint,1,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"` Os *common.OS `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"` Repository *common.Repository `protobuf:"bytes,11,opt,name=repository,proto3" json:"repository,omitempty"` PackageInfos []*common.PackageInfo `protobuf:"bytes,3,rep,name=package_infos,json=packageInfos,proto3" json:"package_infos,omitempty"` Applications []*common.Application `protobuf:"bytes,4,rep,name=applications,proto3" json:"applications,omitempty"` Misconfigurations []*common.Misconfiguration `protobuf:"bytes,9,rep,name=misconfigurations,proto3" json:"misconfigurations,omitempty"` OpaqueDirs []string `protobuf:"bytes,5,rep,name=opaque_dirs,json=opaqueDirs,proto3" json:"opaque_dirs,omitempty"` WhiteoutFiles []string `protobuf:"bytes,6,rep,name=whiteout_files,json=whiteoutFiles,proto3" json:"whiteout_files,omitempty"` Digest string `protobuf:"bytes,7,opt,name=digest,proto3" json:"digest,omitempty"` DiffId string `protobuf:"bytes,8,opt,name=diff_id,json=diffId,proto3" json:"diff_id,omitempty"` CustomResources []*common.CustomResource `protobuf:"bytes,10,rep,name=custom_resources,json=customResources,proto3" json:"custom_resources,omitempty"` Secrets []*common.Secret `protobuf:"bytes,12,rep,name=secrets,proto3" json:"secrets,omitempty"` // contains filtered or unexported fields }
func (*BlobInfo) Descriptor
deprecated
func (*BlobInfo) GetApplications ¶
func (x *BlobInfo) GetApplications() []*common.Application
func (*BlobInfo) GetCustomResources ¶
func (x *BlobInfo) GetCustomResources() []*common.CustomResource
func (*BlobInfo) GetMisconfigurations ¶
func (x *BlobInfo) GetMisconfigurations() []*common.Misconfiguration
func (*BlobInfo) GetOpaqueDirs ¶
func (*BlobInfo) GetPackageInfos ¶
func (x *BlobInfo) GetPackageInfos() []*common.PackageInfo
func (*BlobInfo) GetRepository ¶
func (x *BlobInfo) GetRepository() *common.Repository
func (*BlobInfo) GetSchemaVersion ¶
func (*BlobInfo) GetSecrets ¶
func (*BlobInfo) GetWhiteoutFiles ¶
func (*BlobInfo) ProtoMessage ¶
func (*BlobInfo) ProtoMessage()
func (*BlobInfo) ProtoReflect ¶
func (x *BlobInfo) ProtoReflect() protoreflect.Message
type Cache ¶
type Cache interface { PutArtifact(context.Context, *PutArtifactRequest) (*google_protobuf2.Empty, error) PutBlob(context.Context, *PutBlobRequest) (*google_protobuf2.Empty, error) MissingBlobs(context.Context, *MissingBlobsRequest) (*MissingBlobsResponse, error) DeleteBlobs(context.Context, *DeleteBlobsRequest) (*google_protobuf2.Empty, error) }
func NewCacheJSONClient ¶
func NewCacheJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Cache
NewCacheJSONClient creates a JSON client that implements the Cache interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewCacheProtobufClient ¶
func NewCacheProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Cache
NewCacheProtobufClient creates a Protobuf client that implements the Cache interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type DeleteBlobsRequest ¶
type DeleteBlobsRequest struct { BlobIds []string `protobuf:"bytes,1,rep,name=blob_ids,json=blobIds,proto3" json:"blob_ids,omitempty"` // contains filtered or unexported fields }
func (*DeleteBlobsRequest) Descriptor
deprecated
func (*DeleteBlobsRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBlobsRequest.ProtoReflect.Descriptor instead.
func (*DeleteBlobsRequest) GetBlobIds ¶
func (x *DeleteBlobsRequest) GetBlobIds() []string
func (*DeleteBlobsRequest) ProtoMessage ¶
func (*DeleteBlobsRequest) ProtoMessage()
func (*DeleteBlobsRequest) ProtoReflect ¶
func (x *DeleteBlobsRequest) ProtoReflect() protoreflect.Message
func (*DeleteBlobsRequest) Reset ¶
func (x *DeleteBlobsRequest) Reset()
func (*DeleteBlobsRequest) String ¶
func (x *DeleteBlobsRequest) String() string
type HTTPClient ¶
HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.
HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.
type MissingBlobsRequest ¶
type MissingBlobsRequest struct { ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` BlobIds []string `protobuf:"bytes,2,rep,name=blob_ids,json=blobIds,proto3" json:"blob_ids,omitempty"` // contains filtered or unexported fields }
func (*MissingBlobsRequest) Descriptor
deprecated
func (*MissingBlobsRequest) Descriptor() ([]byte, []int)
Deprecated: Use MissingBlobsRequest.ProtoReflect.Descriptor instead.
func (*MissingBlobsRequest) GetArtifactId ¶
func (x *MissingBlobsRequest) GetArtifactId() string
func (*MissingBlobsRequest) GetBlobIds ¶
func (x *MissingBlobsRequest) GetBlobIds() []string
func (*MissingBlobsRequest) ProtoMessage ¶
func (*MissingBlobsRequest) ProtoMessage()
func (*MissingBlobsRequest) ProtoReflect ¶
func (x *MissingBlobsRequest) ProtoReflect() protoreflect.Message
func (*MissingBlobsRequest) Reset ¶
func (x *MissingBlobsRequest) Reset()
func (*MissingBlobsRequest) String ¶
func (x *MissingBlobsRequest) String() string
type MissingBlobsResponse ¶
type MissingBlobsResponse struct { MissingArtifact bool `protobuf:"varint,1,opt,name=missing_artifact,json=missingArtifact,proto3" json:"missing_artifact,omitempty"` MissingBlobIds []string `protobuf:"bytes,2,rep,name=missing_blob_ids,json=missingBlobIds,proto3" json:"missing_blob_ids,omitempty"` // contains filtered or unexported fields }
func (*MissingBlobsResponse) Descriptor
deprecated
func (*MissingBlobsResponse) Descriptor() ([]byte, []int)
Deprecated: Use MissingBlobsResponse.ProtoReflect.Descriptor instead.
func (*MissingBlobsResponse) GetMissingArtifact ¶
func (x *MissingBlobsResponse) GetMissingArtifact() bool
func (*MissingBlobsResponse) GetMissingBlobIds ¶
func (x *MissingBlobsResponse) GetMissingBlobIds() []string
func (*MissingBlobsResponse) ProtoMessage ¶
func (*MissingBlobsResponse) ProtoMessage()
func (*MissingBlobsResponse) ProtoReflect ¶
func (x *MissingBlobsResponse) ProtoReflect() protoreflect.Message
func (*MissingBlobsResponse) Reset ¶
func (x *MissingBlobsResponse) Reset()
func (*MissingBlobsResponse) String ¶
func (x *MissingBlobsResponse) String() string
type PutArtifactRequest ¶
type PutArtifactRequest struct { ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` ArtifactInfo *ArtifactInfo `protobuf:"bytes,2,opt,name=artifact_info,json=artifactInfo,proto3" json:"artifact_info,omitempty"` // contains filtered or unexported fields }
func (*PutArtifactRequest) Descriptor
deprecated
func (*PutArtifactRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutArtifactRequest.ProtoReflect.Descriptor instead.
func (*PutArtifactRequest) GetArtifactId ¶
func (x *PutArtifactRequest) GetArtifactId() string
func (*PutArtifactRequest) GetArtifactInfo ¶
func (x *PutArtifactRequest) GetArtifactInfo() *ArtifactInfo
func (*PutArtifactRequest) ProtoMessage ¶
func (*PutArtifactRequest) ProtoMessage()
func (*PutArtifactRequest) ProtoReflect ¶
func (x *PutArtifactRequest) ProtoReflect() protoreflect.Message
func (*PutArtifactRequest) Reset ¶
func (x *PutArtifactRequest) Reset()
func (*PutArtifactRequest) String ¶
func (x *PutArtifactRequest) String() string
type PutBlobRequest ¶
type PutBlobRequest struct { DiffId string `protobuf:"bytes,1,opt,name=diff_id,json=diffId,proto3" json:"diff_id,omitempty"` BlobInfo *BlobInfo `protobuf:"bytes,3,opt,name=blob_info,json=blobInfo,proto3" json:"blob_info,omitempty"` // contains filtered or unexported fields }
func (*PutBlobRequest) Descriptor
deprecated
func (*PutBlobRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutBlobRequest.ProtoReflect.Descriptor instead.
func (*PutBlobRequest) GetBlobInfo ¶
func (x *PutBlobRequest) GetBlobInfo() *BlobInfo
func (*PutBlobRequest) GetDiffId ¶
func (x *PutBlobRequest) GetDiffId() string
func (*PutBlobRequest) ProtoMessage ¶
func (*PutBlobRequest) ProtoMessage()
func (*PutBlobRequest) ProtoReflect ¶
func (x *PutBlobRequest) ProtoReflect() protoreflect.Message
func (*PutBlobRequest) Reset ¶
func (x *PutBlobRequest) Reset()
func (*PutBlobRequest) String ¶
func (x *PutBlobRequest) String() string
type PutResponse ¶
type PutResponse struct { Os *common.OS `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"` Eosl bool `protobuf:"varint,2,opt,name=eosl,proto3" json:"eosl,omitempty"` // contains filtered or unexported fields }
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) GetEosl ¶
func (x *PutResponse) GetEosl() bool
func (*PutResponse) GetOs ¶
func (x *PutResponse) GetOs() *common.OS
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
type TwirpServer ¶
type TwirpServer interface { http.Handler // ServiceDescriptor returns gzipped bytes describing the .proto file that // this service was generated from. Once unzipped, the bytes can be // unmarshalled as a // google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto. // // The returned integer is the index of this particular service within that // FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a // low-level field, expected to be used for reflection. ServiceDescriptor() ([]byte, int) // ProtocGenTwirpVersion is the semantic version string of the version of // twirp used to generate this file. ProtocGenTwirpVersion() string // PathPrefix returns the HTTP URL path prefix for all methods handled by this // service. This can be used with an HTTP mux to route Twirp requests. // The path prefix is in the form: "/<prefix>/<package>.<Service>/" // that is, everything in a Twirp route except for the <Method> at the end. PathPrefix() string }
TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.
func NewCacheServer ¶
func NewCacheServer(svc Cache, opts ...interface{}) TwirpServer
NewCacheServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).