Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorToAPIStatus(err error) *metav1.Status
- func ExistsReport(fs blobfs.Interface, img string) (bool, error)
- func GRPCCode(err error) gcerrors.ErrorCode
- func GetResponseFromBackend(nc *nats.Conn, img string) (trivy.BackendResponse, error)
- func HTTPStatusFromCode(code gcerrors.ErrorCode) int32
- func NewBlobFS() blobfs.Interface
- func NewConnection(addr, credFile string) (nc *nats.Conn, err error)
- func ReadFromBucket(fs blobfs.Interface, img string) ([]byte, error)
- func UploadReport(fs blobfs.Interface, img string) error
- type Manager
- type Options
Constants ¶
View Source
const ( ScanSubject = "scanner.queue.scan" ReportSubject = "scanner.report" TrivyRefreshPeriod = time.Hour * 6 )
View Source
const ( Dev deploymentMode = iota Production )
Variables ¶
View Source
var DeploymentMode = Dev
Functions ¶
func ErrorToAPIStatus ¶
ErrorToAPIStatus converts an error to an metav1.Status object.
func GRPCCode ¶
GRPCCode extracts the gRPC status code and converts it into an ErrorCode. It returns Unknown if the error isn't from gRPC.
func GetResponseFromBackend ¶ added in v0.0.7
func GetResponseFromBackend(nc *nats.Conn, img string) (trivy.BackendResponse, error)
func HTTPStatusFromCode ¶
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto See: https://github.com/grpc-ecosystem/grpc-gateway/blob/v2.11.3/runtime/errors.go#L34-L77
func NewConnection ¶
NewConnection creates a new NATS connection
func ReadFromBucket ¶ added in v0.0.7
Types ¶
Click to show internal directories.
Click to hide internal directories.