Documentation ¶
Overview ¶
Package cache is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.10.1.
It is generated from these files:
rpc/cache/service.proto
Index ¶
- Constants
- func WriteError(resp http.ResponseWriter, err error)
- type ArtifactInfo
- func (*ArtifactInfo) Descriptor() ([]byte, []int)
- func (m *ArtifactInfo) GetArchitecture() string
- func (m *ArtifactInfo) GetCreated() *timestamppb.Timestamp
- func (m *ArtifactInfo) GetDockerVersion() string
- func (m *ArtifactInfo) GetHistoryPackages() []*common.Package
- func (m *ArtifactInfo) GetOs() string
- func (m *ArtifactInfo) GetSchemaVersion() int32
- func (*ArtifactInfo) ProtoMessage()
- func (m *ArtifactInfo) Reset()
- func (m *ArtifactInfo) String() string
- func (m *ArtifactInfo) XXX_DiscardUnknown()
- func (m *ArtifactInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ArtifactInfo) XXX_Merge(src proto.Message)
- func (m *ArtifactInfo) XXX_Size() int
- func (m *ArtifactInfo) XXX_Unmarshal(b []byte) error
- type BlobInfo
- func (*BlobInfo) Descriptor() ([]byte, []int)
- func (m *BlobInfo) GetApplications() []*common.Application
- func (m *BlobInfo) GetDiffId() string
- func (m *BlobInfo) GetDigest() string
- func (m *BlobInfo) GetOpaqueDirs() []string
- func (m *BlobInfo) GetOs() *common.OS
- func (m *BlobInfo) GetPackageInfos() []*common.PackageInfo
- func (m *BlobInfo) GetSchemaVersion() int32
- func (m *BlobInfo) GetWhiteoutFiles() []string
- func (*BlobInfo) ProtoMessage()
- func (m *BlobInfo) Reset()
- func (m *BlobInfo) String() string
- func (m *BlobInfo) XXX_DiscardUnknown()
- func (m *BlobInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlobInfo) XXX_Merge(src proto.Message)
- func (m *BlobInfo) XXX_Size() int
- func (m *BlobInfo) XXX_Unmarshal(b []byte) error
- type Cache
- type HTTPClient
- type MissingBlobsRequest
- func (*MissingBlobsRequest) Descriptor() ([]byte, []int)
- func (m *MissingBlobsRequest) GetArtifactId() string
- func (m *MissingBlobsRequest) GetBlobIds() []string
- func (*MissingBlobsRequest) ProtoMessage()
- func (m *MissingBlobsRequest) Reset()
- func (m *MissingBlobsRequest) String() string
- func (m *MissingBlobsRequest) XXX_DiscardUnknown()
- func (m *MissingBlobsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MissingBlobsRequest) XXX_Merge(src proto.Message)
- func (m *MissingBlobsRequest) XXX_Size() int
- func (m *MissingBlobsRequest) XXX_Unmarshal(b []byte) error
- type MissingBlobsResponse
- func (*MissingBlobsResponse) Descriptor() ([]byte, []int)
- func (m *MissingBlobsResponse) GetMissingArtifact() bool
- func (m *MissingBlobsResponse) GetMissingBlobIds() []string
- func (*MissingBlobsResponse) ProtoMessage()
- func (m *MissingBlobsResponse) Reset()
- func (m *MissingBlobsResponse) String() string
- func (m *MissingBlobsResponse) XXX_DiscardUnknown()
- func (m *MissingBlobsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MissingBlobsResponse) XXX_Merge(src proto.Message)
- func (m *MissingBlobsResponse) XXX_Size() int
- func (m *MissingBlobsResponse) XXX_Unmarshal(b []byte) error
- type PutArtifactRequest
- func (*PutArtifactRequest) Descriptor() ([]byte, []int)
- func (m *PutArtifactRequest) GetArtifactId() string
- func (m *PutArtifactRequest) GetArtifactInfo() *ArtifactInfo
- func (*PutArtifactRequest) ProtoMessage()
- func (m *PutArtifactRequest) Reset()
- func (m *PutArtifactRequest) String() string
- func (m *PutArtifactRequest) XXX_DiscardUnknown()
- func (m *PutArtifactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutArtifactRequest) XXX_Merge(src proto.Message)
- func (m *PutArtifactRequest) XXX_Size() int
- func (m *PutArtifactRequest) XXX_Unmarshal(b []byte) error
- type PutBlobRequest
- func (*PutBlobRequest) Descriptor() ([]byte, []int)
- func (m *PutBlobRequest) GetBlobInfo() *BlobInfo
- func (m *PutBlobRequest) GetDiffId() string
- func (*PutBlobRequest) ProtoMessage()
- func (m *PutBlobRequest) Reset()
- func (m *PutBlobRequest) String() string
- func (m *PutBlobRequest) XXX_DiscardUnknown()
- func (m *PutBlobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutBlobRequest) XXX_Merge(src proto.Message)
- func (m *PutBlobRequest) XXX_Size() int
- func (m *PutBlobRequest) XXX_Unmarshal(b []byte) error
- type PutResponse
- func (*PutResponse) Descriptor() ([]byte, []int)
- func (m *PutResponse) GetEosl() bool
- func (m *PutResponse) GetOs() *common.OS
- func (*PutResponse) ProtoMessage()
- func (m *PutResponse) Reset()
- func (m *PutResponse) String() string
- func (m *PutResponse) XXX_DiscardUnknown()
- func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutResponse) XXX_Merge(src proto.Message)
- func (m *PutResponse) XXX_Size() int
- func (m *PutResponse) XXX_Unmarshal(b []byte) error
- type TwirpServer
Constants ¶
const CachePathPrefix = "/twirp/trivy.cache.v1.Cache/"
CachePathPrefix is used for all URL paths on a twirp Cache server. Requests are always: POST CachePathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.
Variables ¶
This section is empty.
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 ¶ added in v0.9.0
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ArtifactInfo) Descriptor ¶ added in v0.9.0
func (*ArtifactInfo) Descriptor() ([]byte, []int)
func (*ArtifactInfo) GetArchitecture ¶ added in v0.9.0
func (m *ArtifactInfo) GetArchitecture() string
func (*ArtifactInfo) GetCreated ¶ added in v0.9.0
func (m *ArtifactInfo) GetCreated() *timestamppb.Timestamp
func (*ArtifactInfo) GetDockerVersion ¶ added in v0.9.0
func (m *ArtifactInfo) GetDockerVersion() string
func (*ArtifactInfo) GetHistoryPackages ¶ added in v0.9.0
func (m *ArtifactInfo) GetHistoryPackages() []*common.Package
func (*ArtifactInfo) GetOs ¶ added in v0.9.0
func (m *ArtifactInfo) GetOs() string
func (*ArtifactInfo) GetSchemaVersion ¶ added in v0.9.0
func (m *ArtifactInfo) GetSchemaVersion() int32
func (*ArtifactInfo) ProtoMessage ¶ added in v0.9.0
func (*ArtifactInfo) ProtoMessage()
func (*ArtifactInfo) Reset ¶ added in v0.9.0
func (m *ArtifactInfo) Reset()
func (*ArtifactInfo) String ¶ added in v0.9.0
func (m *ArtifactInfo) String() string
func (*ArtifactInfo) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *ArtifactInfo) XXX_DiscardUnknown()
func (*ArtifactInfo) XXX_Marshal ¶ added in v0.9.0
func (m *ArtifactInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ArtifactInfo) XXX_Merge ¶ added in v0.9.0
func (m *ArtifactInfo) XXX_Merge(src proto.Message)
func (*ArtifactInfo) XXX_Size ¶ added in v0.9.0
func (m *ArtifactInfo) XXX_Size() int
func (*ArtifactInfo) XXX_Unmarshal ¶ added in v0.9.0
func (m *ArtifactInfo) XXX_Unmarshal(b []byte) error
type BlobInfo ¶ added in v0.9.0
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"` 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"` 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BlobInfo) Descriptor ¶ added in v0.9.0
func (*BlobInfo) GetApplications ¶ added in v0.9.0
func (m *BlobInfo) GetApplications() []*common.Application
func (*BlobInfo) GetOpaqueDirs ¶ added in v0.9.0
func (*BlobInfo) GetPackageInfos ¶ added in v0.9.0
func (m *BlobInfo) GetPackageInfos() []*common.PackageInfo
func (*BlobInfo) GetSchemaVersion ¶ added in v0.9.0
func (*BlobInfo) GetWhiteoutFiles ¶ added in v0.9.0
func (*BlobInfo) ProtoMessage ¶ added in v0.9.0
func (*BlobInfo) ProtoMessage()
func (*BlobInfo) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *BlobInfo) XXX_DiscardUnknown()
func (*BlobInfo) XXX_Marshal ¶ added in v0.9.0
func (*BlobInfo) XXX_Unmarshal ¶ added in v0.9.0
type Cache ¶
type Cache interface { PutArtifact(context.Context, *PutArtifactRequest) (*google_protobuf1.Empty, error) PutBlob(context.Context, *PutBlobRequest) (*google_protobuf1.Empty, error) MissingBlobs(context.Context, *MissingBlobsRequest) (*MissingBlobsResponse, error) }
func NewCacheJSONClient ¶
func NewCacheJSONClient(addr 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(addr 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 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 ¶ added in v0.9.0
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MissingBlobsRequest) Descriptor ¶ added in v0.9.0
func (*MissingBlobsRequest) Descriptor() ([]byte, []int)
func (*MissingBlobsRequest) GetArtifactId ¶ added in v0.9.0
func (m *MissingBlobsRequest) GetArtifactId() string
func (*MissingBlobsRequest) GetBlobIds ¶ added in v0.9.0
func (m *MissingBlobsRequest) GetBlobIds() []string
func (*MissingBlobsRequest) ProtoMessage ¶ added in v0.9.0
func (*MissingBlobsRequest) ProtoMessage()
func (*MissingBlobsRequest) Reset ¶ added in v0.9.0
func (m *MissingBlobsRequest) Reset()
func (*MissingBlobsRequest) String ¶ added in v0.9.0
func (m *MissingBlobsRequest) String() string
func (*MissingBlobsRequest) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *MissingBlobsRequest) XXX_DiscardUnknown()
func (*MissingBlobsRequest) XXX_Marshal ¶ added in v0.9.0
func (m *MissingBlobsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MissingBlobsRequest) XXX_Merge ¶ added in v0.9.0
func (m *MissingBlobsRequest) XXX_Merge(src proto.Message)
func (*MissingBlobsRequest) XXX_Size ¶ added in v0.9.0
func (m *MissingBlobsRequest) XXX_Size() int
func (*MissingBlobsRequest) XXX_Unmarshal ¶ added in v0.9.0
func (m *MissingBlobsRequest) XXX_Unmarshal(b []byte) error
type MissingBlobsResponse ¶ added in v0.9.0
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MissingBlobsResponse) Descriptor ¶ added in v0.9.0
func (*MissingBlobsResponse) Descriptor() ([]byte, []int)
func (*MissingBlobsResponse) GetMissingArtifact ¶ added in v0.9.0
func (m *MissingBlobsResponse) GetMissingArtifact() bool
func (*MissingBlobsResponse) GetMissingBlobIds ¶ added in v0.9.0
func (m *MissingBlobsResponse) GetMissingBlobIds() []string
func (*MissingBlobsResponse) ProtoMessage ¶ added in v0.9.0
func (*MissingBlobsResponse) ProtoMessage()
func (*MissingBlobsResponse) Reset ¶ added in v0.9.0
func (m *MissingBlobsResponse) Reset()
func (*MissingBlobsResponse) String ¶ added in v0.9.0
func (m *MissingBlobsResponse) String() string
func (*MissingBlobsResponse) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *MissingBlobsResponse) XXX_DiscardUnknown()
func (*MissingBlobsResponse) XXX_Marshal ¶ added in v0.9.0
func (m *MissingBlobsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MissingBlobsResponse) XXX_Merge ¶ added in v0.9.0
func (m *MissingBlobsResponse) XXX_Merge(src proto.Message)
func (*MissingBlobsResponse) XXX_Size ¶ added in v0.9.0
func (m *MissingBlobsResponse) XXX_Size() int
func (*MissingBlobsResponse) XXX_Unmarshal ¶ added in v0.9.0
func (m *MissingBlobsResponse) XXX_Unmarshal(b []byte) error
type PutArtifactRequest ¶ added in v0.9.0
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutArtifactRequest) Descriptor ¶ added in v0.9.0
func (*PutArtifactRequest) Descriptor() ([]byte, []int)
func (*PutArtifactRequest) GetArtifactId ¶ added in v0.9.0
func (m *PutArtifactRequest) GetArtifactId() string
func (*PutArtifactRequest) GetArtifactInfo ¶ added in v0.9.0
func (m *PutArtifactRequest) GetArtifactInfo() *ArtifactInfo
func (*PutArtifactRequest) ProtoMessage ¶ added in v0.9.0
func (*PutArtifactRequest) ProtoMessage()
func (*PutArtifactRequest) Reset ¶ added in v0.9.0
func (m *PutArtifactRequest) Reset()
func (*PutArtifactRequest) String ¶ added in v0.9.0
func (m *PutArtifactRequest) String() string
func (*PutArtifactRequest) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *PutArtifactRequest) XXX_DiscardUnknown()
func (*PutArtifactRequest) XXX_Marshal ¶ added in v0.9.0
func (m *PutArtifactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutArtifactRequest) XXX_Merge ¶ added in v0.9.0
func (m *PutArtifactRequest) XXX_Merge(src proto.Message)
func (*PutArtifactRequest) XXX_Size ¶ added in v0.9.0
func (m *PutArtifactRequest) XXX_Size() int
func (*PutArtifactRequest) XXX_Unmarshal ¶ added in v0.9.0
func (m *PutArtifactRequest) XXX_Unmarshal(b []byte) error
type PutBlobRequest ¶ added in v0.9.0
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutBlobRequest) Descriptor ¶ added in v0.9.0
func (*PutBlobRequest) Descriptor() ([]byte, []int)
func (*PutBlobRequest) GetBlobInfo ¶ added in v0.9.0
func (m *PutBlobRequest) GetBlobInfo() *BlobInfo
func (*PutBlobRequest) GetDiffId ¶ added in v0.9.0
func (m *PutBlobRequest) GetDiffId() string
func (*PutBlobRequest) ProtoMessage ¶ added in v0.9.0
func (*PutBlobRequest) ProtoMessage()
func (*PutBlobRequest) Reset ¶ added in v0.9.0
func (m *PutBlobRequest) Reset()
func (*PutBlobRequest) String ¶ added in v0.9.0
func (m *PutBlobRequest) String() string
func (*PutBlobRequest) XXX_DiscardUnknown ¶ added in v0.9.0
func (m *PutBlobRequest) XXX_DiscardUnknown()
func (*PutBlobRequest) XXX_Marshal ¶ added in v0.9.0
func (m *PutBlobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutBlobRequest) XXX_Merge ¶ added in v0.9.0
func (m *PutBlobRequest) XXX_Merge(src proto.Message)
func (*PutBlobRequest) XXX_Size ¶ added in v0.9.0
func (m *PutBlobRequest) XXX_Size() int
func (*PutBlobRequest) XXX_Unmarshal ¶ added in v0.9.0
func (m *PutBlobRequest) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutResponse) Descriptor ¶
func (*PutResponse) Descriptor() ([]byte, []int)
func (*PutResponse) GetEosl ¶
func (m *PutResponse) GetEosl() bool
func (*PutResponse) GetOs ¶
func (m *PutResponse) GetOs() *common.OS
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) Reset ¶
func (m *PutResponse) Reset()
func (*PutResponse) String ¶
func (m *PutResponse) String() string
func (*PutResponse) XXX_DiscardUnknown ¶
func (m *PutResponse) XXX_DiscardUnknown()
func (*PutResponse) XXX_Marshal ¶
func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutResponse) XXX_Merge ¶
func (m *PutResponse) XXX_Merge(src proto.Message)
func (*PutResponse) XXX_Size ¶
func (m *PutResponse) XXX_Size() int
func (*PutResponse) XXX_Unmarshal ¶
func (m *PutResponse) XXX_Unmarshal(b []byte) error
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 // github.com/golang/protobuf/protoc-gen-go/descriptor.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 // alongside non-twirp requests on one HTTP listener. 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, hooks *twirp.ServerHooks) TwirpServer