detector

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package detector 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/detector/service.proto

Index

Constants

View Source
const CompressThreshold = 10000

A response is compressed with gzip when the response size exceeds this threshold.

View Source
const LibDetectorPathPrefix = "/twirp/trivy.detector.LibDetector/"

LibDetectorPathPrefix is used for all URL paths on a twirp LibDetector server. Requests are always: POST LibDetectorPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

View Source
const OSDetectorPathPrefix = "/twirp/trivy.detector.OSDetector/"

OSDetectorPathPrefix is used for all URL paths on a twirp OSDetector server. Requests are always: POST OSDetectorPathPrefix/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 DetectResponse

type DetectResponse struct {
	Vulnerabilities      []*common.Vulnerability `protobuf:"bytes,1,rep,name=vulnerabilities,proto3" json:"vulnerabilities,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 (*DetectResponse) Descriptor

func (*DetectResponse) Descriptor() ([]byte, []int)

func (*DetectResponse) GetEosl

func (m *DetectResponse) GetEosl() bool

func (*DetectResponse) GetVulnerabilities

func (m *DetectResponse) GetVulnerabilities() []*common.Vulnerability

func (*DetectResponse) ProtoMessage

func (*DetectResponse) ProtoMessage()

func (*DetectResponse) Reset

func (m *DetectResponse) Reset()

func (*DetectResponse) String

func (m *DetectResponse) String() string

func (*DetectResponse) XXX_DiscardUnknown

func (m *DetectResponse) XXX_DiscardUnknown()

func (*DetectResponse) XXX_Marshal

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

func (*DetectResponse) XXX_Merge

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

func (*DetectResponse) XXX_Size

func (m *DetectResponse) XXX_Size() int

func (*DetectResponse) XXX_Unmarshal

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

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 LibDetectRequest

type LibDetectRequest struct {
	FilePath             string               `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
	Libraries            []*common.Library    `protobuf:"bytes,2,rep,name=libraries,proto3" json:"libraries,omitempty"`
	ImageName            string               `protobuf:"bytes,3,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"`
	Created              *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*LibDetectRequest) Descriptor

func (*LibDetectRequest) Descriptor() ([]byte, []int)

func (*LibDetectRequest) GetCreated added in v0.4.4

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

func (*LibDetectRequest) GetFilePath

func (m *LibDetectRequest) GetFilePath() string

func (*LibDetectRequest) GetImageName added in v0.4.4

func (m *LibDetectRequest) GetImageName() string

func (*LibDetectRequest) GetLibraries

func (m *LibDetectRequest) GetLibraries() []*common.Library

func (*LibDetectRequest) ProtoMessage

func (*LibDetectRequest) ProtoMessage()

func (*LibDetectRequest) Reset

func (m *LibDetectRequest) Reset()

func (*LibDetectRequest) String

func (m *LibDetectRequest) String() string

func (*LibDetectRequest) XXX_DiscardUnknown

func (m *LibDetectRequest) XXX_DiscardUnknown()

func (*LibDetectRequest) XXX_Marshal

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

func (*LibDetectRequest) XXX_Merge

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

func (*LibDetectRequest) XXX_Size

func (m *LibDetectRequest) XXX_Size() int

func (*LibDetectRequest) XXX_Unmarshal

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

type LibDetector

type LibDetector interface {
	Detect(context.Context, *LibDetectRequest) (*DetectResponse, error)
}

func NewLibDetectorJSONClient

func NewLibDetectorJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) LibDetector

NewLibDetectorJSONClient creates a JSON client that implements the LibDetector interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewLibDetectorProtobufClient

func NewLibDetectorProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) LibDetector

NewLibDetectorProtobufClient creates a Protobuf client that implements the LibDetector interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type OSDetectRequest

type OSDetectRequest struct {
	OsFamily             string               `protobuf:"bytes,1,opt,name=os_family,json=osFamily,proto3" json:"os_family,omitempty"`
	OsName               string               `protobuf:"bytes,2,opt,name=os_name,json=osName,proto3" json:"os_name,omitempty"`
	Packages             []*common.Package    `protobuf:"bytes,3,rep,name=packages,proto3" json:"packages,omitempty"`
	ImageName            string               `protobuf:"bytes,4,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"`
	Created              *timestamp.Timestamp `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*OSDetectRequest) Descriptor

func (*OSDetectRequest) Descriptor() ([]byte, []int)

func (*OSDetectRequest) GetCreated added in v0.4.4

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

func (*OSDetectRequest) GetImageName added in v0.4.4

func (m *OSDetectRequest) GetImageName() string

func (*OSDetectRequest) GetOsFamily

func (m *OSDetectRequest) GetOsFamily() string

func (*OSDetectRequest) GetOsName

func (m *OSDetectRequest) GetOsName() string

func (*OSDetectRequest) GetPackages

func (m *OSDetectRequest) GetPackages() []*common.Package

func (*OSDetectRequest) ProtoMessage

func (*OSDetectRequest) ProtoMessage()

func (*OSDetectRequest) Reset

func (m *OSDetectRequest) Reset()

func (*OSDetectRequest) String

func (m *OSDetectRequest) String() string

func (*OSDetectRequest) XXX_DiscardUnknown

func (m *OSDetectRequest) XXX_DiscardUnknown()

func (*OSDetectRequest) XXX_Marshal

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

func (*OSDetectRequest) XXX_Merge

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

func (*OSDetectRequest) XXX_Size

func (m *OSDetectRequest) XXX_Size() int

func (*OSDetectRequest) XXX_Unmarshal

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

type OSDetector

type OSDetector interface {
	Detect(context.Context, *OSDetectRequest) (*DetectResponse, error)
}

func NewOSDetectorJSONClient

func NewOSDetectorJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) OSDetector

NewOSDetectorJSONClient creates a JSON client that implements the OSDetector interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewOSDetectorProtobufClient

func NewOSDetectorProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) OSDetector

NewOSDetectorProtobufClient creates a Protobuf client that implements the OSDetector interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

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 NewLibDetectorServer

func NewLibDetectorServer(svc LibDetector, hooks *twirp.ServerHooks) TwirpServer

func NewOSDetectorServer

func NewOSDetectorServer(svc OSDetector, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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