cache

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 18 Imported by: 3

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

View Source
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

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

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

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) Descriptor() ([]byte, []int)

func (*ImageInfo) GetArchitecture

func (m *ImageInfo) GetArchitecture() string

func (*ImageInfo) GetCreated

func (m *ImageInfo) GetCreated() *timestamp.Timestamp

func (*ImageInfo) GetDockerVersion

func (m *ImageInfo) GetDockerVersion() string

func (*ImageInfo) GetHistoryPackages

func (m *ImageInfo) GetHistoryPackages() []*common.Package

func (*ImageInfo) GetOs

func (m *ImageInfo) GetOs() string

func (*ImageInfo) GetSchemaVersion

func (m *ImageInfo) GetSchemaVersion() int32

func (*ImageInfo) ProtoMessage

func (*ImageInfo) ProtoMessage()

func (*ImageInfo) Reset

func (m *ImageInfo) Reset()

func (*ImageInfo) String

func (m *ImageInfo) String() string

func (*ImageInfo) XXX_DiscardUnknown

func (m *ImageInfo) XXX_DiscardUnknown()

func (*ImageInfo) XXX_Marshal

func (m *ImageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ImageInfo) XXX_Merge

func (m *ImageInfo) XXX_Merge(src proto.Message)

func (*ImageInfo) XXX_Size

func (m *ImageInfo) XXX_Size() int

func (*ImageInfo) XXX_Unmarshal

func (m *ImageInfo) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*LayerInfo) GetApplications

func (m *LayerInfo) GetApplications() []*common.Application

func (*LayerInfo) GetOpaqueDirs

func (m *LayerInfo) GetOpaqueDirs() []string

func (*LayerInfo) GetOs

func (m *LayerInfo) GetOs() *common.OS

func (*LayerInfo) GetPackageInfos

func (m *LayerInfo) GetPackageInfos() []*common.PackageInfo

func (*LayerInfo) GetSchemaVersion

func (m *LayerInfo) GetSchemaVersion() int32

func (*LayerInfo) GetWhiteoutFiles

func (m *LayerInfo) GetWhiteoutFiles() []string

func (*LayerInfo) ProtoMessage

func (*LayerInfo) ProtoMessage()

func (*LayerInfo) Reset

func (m *LayerInfo) Reset()

func (*LayerInfo) String

func (m *LayerInfo) String() string

func (*LayerInfo) XXX_DiscardUnknown

func (m *LayerInfo) XXX_DiscardUnknown()

func (*LayerInfo) XXX_Marshal

func (m *LayerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LayerInfo) XXX_Merge

func (m *LayerInfo) XXX_Merge(src proto.Message)

func (*LayerInfo) XXX_Size

func (m *LayerInfo) XXX_Size() int

func (*LayerInfo) XXX_Unmarshal

func (m *LayerInfo) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

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