Documentation ¶
Overview ¶
Package scanner 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/scanner/service.proto
Index ¶
- Constants
- func WriteError(resp http.ResponseWriter, err error)
- type HTTPClient
- type Result
- func (*Result) Descriptor() ([]byte, []int)
- func (m *Result) GetTarget() string
- func (m *Result) GetType() string
- func (m *Result) GetVulnerabilities() []*common.Vulnerability
- func (*Result) ProtoMessage()
- func (m *Result) Reset()
- func (m *Result) String() string
- func (m *Result) XXX_DiscardUnknown()
- func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Result) XXX_Merge(src proto.Message)
- func (m *Result) XXX_Size() int
- func (m *Result) XXX_Unmarshal(b []byte) error
- type ScanOptions
- func (*ScanOptions) Descriptor() ([]byte, []int)
- func (m *ScanOptions) GetVulnType() []string
- func (*ScanOptions) ProtoMessage()
- func (m *ScanOptions) Reset()
- func (m *ScanOptions) String() string
- func (m *ScanOptions) XXX_DiscardUnknown()
- func (m *ScanOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ScanOptions) XXX_Merge(src proto.Message)
- func (m *ScanOptions) XXX_Size() int
- func (m *ScanOptions) XXX_Unmarshal(b []byte) error
- type ScanRequest
- func (*ScanRequest) Descriptor() ([]byte, []int)
- func (m *ScanRequest) GetArtifactId() string
- func (m *ScanRequest) GetBlobIds() []string
- func (m *ScanRequest) GetOptions() *ScanOptions
- func (m *ScanRequest) GetTarget() string
- func (*ScanRequest) ProtoMessage()
- func (m *ScanRequest) Reset()
- func (m *ScanRequest) String() string
- func (m *ScanRequest) XXX_DiscardUnknown()
- func (m *ScanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ScanRequest) XXX_Merge(src proto.Message)
- func (m *ScanRequest) XXX_Size() int
- func (m *ScanRequest) XXX_Unmarshal(b []byte) error
- type ScanResponse
- func (*ScanResponse) Descriptor() ([]byte, []int)
- func (m *ScanResponse) GetEosl() bool
- func (m *ScanResponse) GetOs() *common.OS
- func (m *ScanResponse) GetResults() []*Result
- func (*ScanResponse) ProtoMessage()
- func (m *ScanResponse) Reset()
- func (m *ScanResponse) String() string
- func (m *ScanResponse) XXX_DiscardUnknown()
- func (m *ScanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ScanResponse) XXX_Merge(src proto.Message)
- func (m *ScanResponse) XXX_Size() int
- func (m *ScanResponse) XXX_Unmarshal(b []byte) error
- type Scanner
- type TwirpServer
Constants ¶
const CompressThreshold = 10000
A response is compressed with gzip when the response size exceeds this threshold.
const ScannerPathPrefix = "/twirp/trivy.scanner.v1.Scanner/"
ScannerPathPrefix is used for all URL paths on a twirp Scanner server. Requests are always: POST ScannerPathPrefix/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 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 Result ¶
type Result struct { Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` Vulnerabilities []*common.Vulnerability `protobuf:"bytes,2,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Result is the same as github.com/aquasecurity/trivy/pkg/report.Result
func (*Result) Descriptor ¶
func (*Result) GetVulnerabilities ¶
func (m *Result) GetVulnerabilities() []*common.Vulnerability
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) XXX_DiscardUnknown ¶
func (m *Result) XXX_DiscardUnknown()
func (*Result) XXX_Marshal ¶
func (*Result) XXX_Unmarshal ¶
type ScanOptions ¶
type ScanOptions struct { VulnType []string `protobuf:"bytes,1,rep,name=vuln_type,json=vulnType,proto3" json:"vuln_type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ScanOptions) Descriptor ¶
func (*ScanOptions) Descriptor() ([]byte, []int)
func (*ScanOptions) GetVulnType ¶
func (m *ScanOptions) GetVulnType() []string
func (*ScanOptions) ProtoMessage ¶
func (*ScanOptions) ProtoMessage()
func (*ScanOptions) Reset ¶
func (m *ScanOptions) Reset()
func (*ScanOptions) String ¶
func (m *ScanOptions) String() string
func (*ScanOptions) XXX_DiscardUnknown ¶
func (m *ScanOptions) XXX_DiscardUnknown()
func (*ScanOptions) XXX_Marshal ¶
func (m *ScanOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ScanOptions) XXX_Merge ¶
func (m *ScanOptions) XXX_Merge(src proto.Message)
func (*ScanOptions) XXX_Size ¶
func (m *ScanOptions) XXX_Size() int
func (*ScanOptions) XXX_Unmarshal ¶
func (m *ScanOptions) XXX_Unmarshal(b []byte) error
type ScanRequest ¶
type ScanRequest struct { Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` ArtifactId string `protobuf:"bytes,2,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` BlobIds []string `protobuf:"bytes,3,rep,name=blob_ids,json=blobIds,proto3" json:"blob_ids,omitempty"` Options *ScanOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ScanRequest) Descriptor ¶
func (*ScanRequest) Descriptor() ([]byte, []int)
func (*ScanRequest) GetArtifactId ¶ added in v0.9.0
func (m *ScanRequest) GetArtifactId() string
func (*ScanRequest) GetBlobIds ¶ added in v0.9.0
func (m *ScanRequest) GetBlobIds() []string
func (*ScanRequest) GetOptions ¶
func (m *ScanRequest) GetOptions() *ScanOptions
func (*ScanRequest) GetTarget ¶
func (m *ScanRequest) GetTarget() string
func (*ScanRequest) ProtoMessage ¶
func (*ScanRequest) ProtoMessage()
func (*ScanRequest) Reset ¶
func (m *ScanRequest) Reset()
func (*ScanRequest) String ¶
func (m *ScanRequest) String() string
func (*ScanRequest) XXX_DiscardUnknown ¶
func (m *ScanRequest) XXX_DiscardUnknown()
func (*ScanRequest) XXX_Marshal ¶
func (m *ScanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ScanRequest) XXX_Merge ¶
func (m *ScanRequest) XXX_Merge(src proto.Message)
func (*ScanRequest) XXX_Size ¶
func (m *ScanRequest) XXX_Size() int
func (*ScanRequest) XXX_Unmarshal ¶
func (m *ScanRequest) XXX_Unmarshal(b []byte) error
type ScanResponse ¶
type ScanResponse 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"` Results []*Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ScanResponse) Descriptor ¶
func (*ScanResponse) Descriptor() ([]byte, []int)
func (*ScanResponse) GetEosl ¶
func (m *ScanResponse) GetEosl() bool
func (*ScanResponse) GetOs ¶
func (m *ScanResponse) GetOs() *common.OS
func (*ScanResponse) GetResults ¶
func (m *ScanResponse) GetResults() []*Result
func (*ScanResponse) ProtoMessage ¶
func (*ScanResponse) ProtoMessage()
func (*ScanResponse) Reset ¶
func (m *ScanResponse) Reset()
func (*ScanResponse) String ¶
func (m *ScanResponse) String() string
func (*ScanResponse) XXX_DiscardUnknown ¶
func (m *ScanResponse) XXX_DiscardUnknown()
func (*ScanResponse) XXX_Marshal ¶
func (m *ScanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ScanResponse) XXX_Merge ¶
func (m *ScanResponse) XXX_Merge(src proto.Message)
func (*ScanResponse) XXX_Size ¶
func (m *ScanResponse) XXX_Size() int
func (*ScanResponse) XXX_Unmarshal ¶
func (m *ScanResponse) XXX_Unmarshal(b []byte) error
type Scanner ¶
type Scanner interface {
Scan(context.Context, *ScanRequest) (*ScanResponse, error)
}
func NewScannerJSONClient ¶
func NewScannerJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Scanner
NewScannerJSONClient creates a JSON client that implements the Scanner interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewScannerProtobufClient ¶
func NewScannerProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Scanner
NewScannerProtobufClient creates a Protobuf client that implements the Scanner 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 NewScannerServer ¶
func NewScannerServer(svc Scanner, hooks *twirp.ServerHooks) TwirpServer