database

package
v0.0.0-...-5f6b411 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	SBOMTable() SBOMTable
}

type Handler

type Handler struct {
	DB *gorm.DB
}

func InitDataBase

func InitDataBase(enableDBInfoLogs bool) *Handler

func (*Handler) CreateFakeData

func (db *Handler) CreateFakeData()

func (*Handler) SBOMTable

func (db *Handler) SBOMTable() SBOMTable

type SBOM

type SBOM struct {
	ID string `gorm:"primarykey" faker:"-"` // consists of the resource hash

	ResourceHash string `json:"resource_hash,omitempty" gorm:"column:resource_hash" faker:"oneof: hash1, hash2, hash3"`
	SBOM         string `json:"sbom,omitempty" gorm:"column:sbom" faker:"oneof: sbom1, sbom2, sbom3"`
}

func (SBOM) TableName

func (SBOM) TableName() string

type SBOMTable

type SBOMTable interface {
	CreateOrUpdateSBOM(sbom *SBOM) error
	GetSBOM(resourceHash string) (*SBOM, error)
}

type SBOMTableHandler

type SBOMTableHandler struct {
	// contains filtered or unexported fields
}

func (*SBOMTableHandler) CreateOrUpdateSBOM

func (s *SBOMTableHandler) CreateOrUpdateSBOM(sbom *SBOM) error

func (*SBOMTableHandler) GetSBOM

func (s *SBOMTableHandler) GetSBOM(resourceHash string) (*SBOM, error)

Jump to

Keyboard shortcuts

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