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 Cache
- type HTTPClient
- type ImageInfo
- func (*ImageInfo) Descriptor() ([]byte, []int)
- func (m *ImageInfo) GetArchitecture() string
- func (m *ImageInfo) GetCreated() *timestamp.Timestamp
- func (m *ImageInfo) GetDockerVersion() string
- func (m *ImageInfo) GetHistoryPackages() []*common.Package
- func (m *ImageInfo) GetOs() string
- func (m *ImageInfo) GetSchemaVersion() int32
- func (*ImageInfo) ProtoMessage()
- func (m *ImageInfo) Reset()
- func (m *ImageInfo) String() string
- func (m *ImageInfo) XXX_DiscardUnknown()
- func (m *ImageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ImageInfo) XXX_Merge(src proto.Message)
- func (m *ImageInfo) XXX_Size() int
- func (m *ImageInfo) XXX_Unmarshal(b []byte) error
- type LayerInfo
- func (*LayerInfo) Descriptor() ([]byte, []int)
- func (m *LayerInfo) GetApplications() []*common.Application
- func (m *LayerInfo) GetOpaqueDirs() []string
- func (m *LayerInfo) GetOs() *common.OS
- func (m *LayerInfo) GetPackageInfos() []*common.PackageInfo
- func (m *LayerInfo) GetSchemaVersion() int32
- func (m *LayerInfo) GetWhiteoutFiles() []string
- func (*LayerInfo) ProtoMessage()
- func (m *LayerInfo) Reset()
- func (m *LayerInfo) String() string
- func (m *LayerInfo) XXX_DiscardUnknown()
- func (m *LayerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LayerInfo) XXX_Merge(src proto.Message)
- func (m *LayerInfo) XXX_Size() int
- func (m *LayerInfo) XXX_Unmarshal(b []byte) error
- type MissingLayersRequest
- func (*MissingLayersRequest) Descriptor() ([]byte, []int)
- func (m *MissingLayersRequest) GetImageId() string
- func (m *MissingLayersRequest) GetLayerIds() []string
- func (*MissingLayersRequest) ProtoMessage()
- func (m *MissingLayersRequest) Reset()
- func (m *MissingLayersRequest) String() string
- func (m *MissingLayersRequest) XXX_DiscardUnknown()
- func (m *MissingLayersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MissingLayersRequest) XXX_Merge(src proto.Message)
- func (m *MissingLayersRequest) XXX_Size() int
- func (m *MissingLayersRequest) XXX_Unmarshal(b []byte) error
- type MissingLayersResponse
- func (*MissingLayersResponse) Descriptor() ([]byte, []int)
- func (m *MissingLayersResponse) GetMissingImage() bool
- func (m *MissingLayersResponse) GetMissingLayerIds() []string
- func (*MissingLayersResponse) ProtoMessage()
- func (m *MissingLayersResponse) Reset()
- func (m *MissingLayersResponse) String() string
- func (m *MissingLayersResponse) XXX_DiscardUnknown()
- func (m *MissingLayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MissingLayersResponse) XXX_Merge(src proto.Message)
- func (m *MissingLayersResponse) XXX_Size() int
- func (m *MissingLayersResponse) XXX_Unmarshal(b []byte) error
- type PutImageRequest
- func (*PutImageRequest) Descriptor() ([]byte, []int)
- func (m *PutImageRequest) GetImageId() string
- func (m *PutImageRequest) GetImageInfo() *ImageInfo
- func (*PutImageRequest) ProtoMessage()
- func (m *PutImageRequest) Reset()
- func (m *PutImageRequest) String() string
- func (m *PutImageRequest) XXX_DiscardUnknown()
- func (m *PutImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutImageRequest) XXX_Merge(src proto.Message)
- func (m *PutImageRequest) XXX_Size() int
- func (m *PutImageRequest) XXX_Unmarshal(b []byte) error
- type PutLayerRequest
- func (*PutLayerRequest) Descriptor() ([]byte, []int)
- func (m *PutLayerRequest) GetDecompressedLayerId() string
- func (m *PutLayerRequest) GetLayerId() string
- func (m *PutLayerRequest) GetLayerInfo() *LayerInfo
- func (*PutLayerRequest) ProtoMessage()
- func (m *PutLayerRequest) Reset()
- func (m *PutLayerRequest) String() string
- func (m *PutLayerRequest) XXX_DiscardUnknown()
- func (m *PutLayerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutLayerRequest) XXX_Merge(src proto.Message)
- func (m *PutLayerRequest) XXX_Size() int
- func (m *PutLayerRequest) 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 Cache ¶
type Cache interface { PutImage(context.Context, *PutImageRequest) (*google_protobuf1.Empty, error) PutLayer(context.Context, *PutLayerRequest) (*google_protobuf1.Empty, error) MissingLayers(context.Context, *MissingLayersRequest) (*MissingLayersResponse, 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 ImageInfo ¶
type ImageInfo 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 *timestamp.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 (*ImageInfo) Descriptor ¶
func (*ImageInfo) GetArchitecture ¶
func (*ImageInfo) GetCreated ¶
func (*ImageInfo) GetDockerVersion ¶
func (*ImageInfo) GetHistoryPackages ¶
func (*ImageInfo) GetSchemaVersion ¶
func (*ImageInfo) ProtoMessage ¶
func (*ImageInfo) ProtoMessage()
func (*ImageInfo) XXX_DiscardUnknown ¶
func (m *ImageInfo) XXX_DiscardUnknown()
func (*ImageInfo) XXX_Marshal ¶
func (*ImageInfo) XXX_Unmarshal ¶
type LayerInfo ¶
type LayerInfo 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*LayerInfo) Descriptor ¶
func (*LayerInfo) GetApplications ¶
func (m *LayerInfo) GetApplications() []*common.Application
func (*LayerInfo) GetOpaqueDirs ¶
func (*LayerInfo) GetPackageInfos ¶
func (m *LayerInfo) GetPackageInfos() []*common.PackageInfo
func (*LayerInfo) GetSchemaVersion ¶
func (*LayerInfo) GetWhiteoutFiles ¶
func (*LayerInfo) ProtoMessage ¶
func (*LayerInfo) ProtoMessage()
func (*LayerInfo) XXX_DiscardUnknown ¶
func (m *LayerInfo) XXX_DiscardUnknown()
func (*LayerInfo) XXX_Marshal ¶
func (*LayerInfo) XXX_Unmarshal ¶
type MissingLayersRequest ¶
type MissingLayersRequest struct { ImageId string `protobuf:"bytes,1,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` LayerIds []string `protobuf:"bytes,2,rep,name=layer_ids,json=layerIds,proto3" json:"layer_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MissingLayersRequest) Descriptor ¶
func (*MissingLayersRequest) Descriptor() ([]byte, []int)
func (*MissingLayersRequest) GetImageId ¶
func (m *MissingLayersRequest) GetImageId() string
func (*MissingLayersRequest) GetLayerIds ¶
func (m *MissingLayersRequest) GetLayerIds() []string
func (*MissingLayersRequest) ProtoMessage ¶
func (*MissingLayersRequest) ProtoMessage()
func (*MissingLayersRequest) Reset ¶
func (m *MissingLayersRequest) Reset()
func (*MissingLayersRequest) String ¶
func (m *MissingLayersRequest) String() string
func (*MissingLayersRequest) XXX_DiscardUnknown ¶
func (m *MissingLayersRequest) XXX_DiscardUnknown()
func (*MissingLayersRequest) XXX_Marshal ¶
func (m *MissingLayersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MissingLayersRequest) XXX_Merge ¶
func (m *MissingLayersRequest) XXX_Merge(src proto.Message)
func (*MissingLayersRequest) XXX_Size ¶
func (m *MissingLayersRequest) XXX_Size() int
func (*MissingLayersRequest) XXX_Unmarshal ¶
func (m *MissingLayersRequest) XXX_Unmarshal(b []byte) error
type MissingLayersResponse ¶
type MissingLayersResponse struct { MissingImage bool `protobuf:"varint,1,opt,name=missing_image,json=missingImage,proto3" json:"missing_image,omitempty"` MissingLayerIds []string `protobuf:"bytes,2,rep,name=missing_layer_ids,json=missingLayerIds,proto3" json:"missing_layer_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MissingLayersResponse) Descriptor ¶
func (*MissingLayersResponse) Descriptor() ([]byte, []int)
func (*MissingLayersResponse) GetMissingImage ¶
func (m *MissingLayersResponse) GetMissingImage() bool
func (*MissingLayersResponse) GetMissingLayerIds ¶
func (m *MissingLayersResponse) GetMissingLayerIds() []string
func (*MissingLayersResponse) ProtoMessage ¶
func (*MissingLayersResponse) ProtoMessage()
func (*MissingLayersResponse) Reset ¶
func (m *MissingLayersResponse) Reset()
func (*MissingLayersResponse) String ¶
func (m *MissingLayersResponse) String() string
func (*MissingLayersResponse) XXX_DiscardUnknown ¶
func (m *MissingLayersResponse) XXX_DiscardUnknown()
func (*MissingLayersResponse) XXX_Marshal ¶
func (m *MissingLayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MissingLayersResponse) XXX_Merge ¶
func (m *MissingLayersResponse) XXX_Merge(src proto.Message)
func (*MissingLayersResponse) XXX_Size ¶
func (m *MissingLayersResponse) XXX_Size() int
func (*MissingLayersResponse) XXX_Unmarshal ¶
func (m *MissingLayersResponse) XXX_Unmarshal(b []byte) error
type PutImageRequest ¶
type PutImageRequest struct { ImageId string `protobuf:"bytes,1,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` ImageInfo *ImageInfo `protobuf:"bytes,2,opt,name=image_info,json=imageInfo,proto3" json:"image_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutImageRequest) Descriptor ¶
func (*PutImageRequest) Descriptor() ([]byte, []int)
func (*PutImageRequest) GetImageId ¶
func (m *PutImageRequest) GetImageId() string
func (*PutImageRequest) GetImageInfo ¶
func (m *PutImageRequest) GetImageInfo() *ImageInfo
func (*PutImageRequest) ProtoMessage ¶
func (*PutImageRequest) ProtoMessage()
func (*PutImageRequest) Reset ¶
func (m *PutImageRequest) Reset()
func (*PutImageRequest) String ¶
func (m *PutImageRequest) String() string
func (*PutImageRequest) XXX_DiscardUnknown ¶
func (m *PutImageRequest) XXX_DiscardUnknown()
func (*PutImageRequest) XXX_Marshal ¶
func (m *PutImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutImageRequest) XXX_Merge ¶
func (m *PutImageRequest) XXX_Merge(src proto.Message)
func (*PutImageRequest) XXX_Size ¶
func (m *PutImageRequest) XXX_Size() int
func (*PutImageRequest) XXX_Unmarshal ¶
func (m *PutImageRequest) XXX_Unmarshal(b []byte) error
type PutLayerRequest ¶
type PutLayerRequest struct { LayerId string `protobuf:"bytes,1,opt,name=layer_id,json=layerId,proto3" json:"layer_id,omitempty"` DecompressedLayerId string `protobuf:"bytes,2,opt,name=decompressed_layer_id,json=decompressedLayerId,proto3" json:"decompressed_layer_id,omitempty"` LayerInfo *LayerInfo `protobuf:"bytes,3,opt,name=layer_info,json=layerInfo,proto3" json:"layer_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutLayerRequest) Descriptor ¶
func (*PutLayerRequest) Descriptor() ([]byte, []int)
func (*PutLayerRequest) GetDecompressedLayerId ¶
func (m *PutLayerRequest) GetDecompressedLayerId() string
func (*PutLayerRequest) GetLayerId ¶
func (m *PutLayerRequest) GetLayerId() string
func (*PutLayerRequest) GetLayerInfo ¶
func (m *PutLayerRequest) GetLayerInfo() *LayerInfo
func (*PutLayerRequest) ProtoMessage ¶
func (*PutLayerRequest) ProtoMessage()
func (*PutLayerRequest) Reset ¶
func (m *PutLayerRequest) Reset()
func (*PutLayerRequest) String ¶
func (m *PutLayerRequest) String() string
func (*PutLayerRequest) XXX_DiscardUnknown ¶
func (m *PutLayerRequest) XXX_DiscardUnknown()
func (*PutLayerRequest) XXX_Marshal ¶
func (m *PutLayerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutLayerRequest) XXX_Merge ¶
func (m *PutLayerRequest) XXX_Merge(src proto.Message)
func (*PutLayerRequest) XXX_Size ¶
func (m *PutLayerRequest) XXX_Size() int
func (*PutLayerRequest) XXX_Unmarshal ¶
func (m *PutLayerRequest) 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