storage

package
v0.0.0-...-9889339 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportsAutoMigrate

func SupportsAutoMigrate(store Storage) bool

Types

type DatabaseAdapter

type DatabaseAdapter struct {
	DB *gorm.DB
}

func (DatabaseAdapter) GetInspection

func (db DatabaseAdapter) GetInspection(image string) (types.ImageInspect, error)

func (DatabaseAdapter) GetVulnerabilityReport

func (db DatabaseAdapter) GetVulnerabilityReport(image string) (models.Document, error)

func (DatabaseAdapter) StoreInspection

func (db DatabaseAdapter) StoreInspection(image string, inspection types.ImageInspect) error

func (DatabaseAdapter) StoreVulnerabilityReport

func (db DatabaseAdapter) StoreVulnerabilityReport(image string, report models.Document) error

type RedisAdapter

type RedisAdapter struct {
	Client *redis.Client
}

func (RedisAdapter) GetInspection

func (r RedisAdapter) GetInspection(image string) (types.ImageInspect, error)

func (RedisAdapter) GetVulnerabilityReport

func (r RedisAdapter) GetVulnerabilityReport(image string) (models.Document, error)

func (RedisAdapter) StoreInspection

func (r RedisAdapter) StoreInspection(image string, inspection types.ImageInspect) error

func (RedisAdapter) StoreVulnerabilityReport

func (r RedisAdapter) StoreVulnerabilityReport(image string, report models.Document) error

type S3Adapter

type S3Adapter struct {
	Svc    *s3.Client
	Bucket string
}

func (S3Adapter) GetInspection

func (adapter S3Adapter) GetInspection(image string) (types.ImageInspect, error)

func (S3Adapter) GetVulnerabilityReport

func (adapter S3Adapter) GetVulnerabilityReport(image string) (models.Document, error)

func (S3Adapter) StoreInspection

func (adapter S3Adapter) StoreInspection(image string, inspection types.ImageInspect) error

func (S3Adapter) StoreVulnerabilityReport

func (adapter S3Adapter) StoreVulnerabilityReport(image string, report models.Document) error

type Storage

type Storage interface {
	StoreInspection(image string, inspection types.ImageInspect) error
	GetInspection(image string) (types.ImageInspect, error)
	StoreVulnerabilityReport(image string, report models.Document) error
	GetVulnerabilityReport(image string) (models.Document, error)
}

func NewForConfig

func NewForConfig(config *config.Config) (Storage, error)

func NewMysqlAdapter

func NewMysqlAdapter(conf config.Mysql) (Storage, error)

func NewPostgresAdapter

func NewPostgresAdapter(conf config.Postgres) (Storage, error)

func NewRedisAdapter

func NewRedisAdapter(conf config.Redis) (Storage, error)

func NewS3Adapter

func NewS3Adapter(conf config.S3) (Storage, error)

Jump to

Keyboard shortcuts

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