component

package
v0.0.0-...-c101990 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const COMPONENT_COLLECTION = "component"

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentHandler

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

func NewComponentHandler

func NewComponentHandler(store types.ComponentStore, sbomStore types.SbomStore) *ComponentHandler

func (*ComponentHandler) AddComponentUsingSbomId

func (s *ComponentHandler) AddComponentUsingSbomId(c *gin.Context)

curl -X POST "http://localhost:8080/api/v1/component?sbom_id=676852a1af6020598db6e8d6"

func (*ComponentHandler) GetComponentById

func (s *ComponentHandler) GetComponentById(c *gin.Context)

curl http://localhost:8080/api/v1/component/{component_id}

func (*ComponentHandler) GetComponentByName

func (s *ComponentHandler) GetComponentByName(c *gin.Context)

curl "http://localhost:8080/api/v1/component/getByName?name=enigma"

func (*ComponentHandler) GetComponents

func (s *ComponentHandler) GetComponents(c *gin.Context)

curl "http://localhost:8080/api/v1/component?page=1&limit=10"

func (*ComponentHandler) GetVulnerableComponents

func (s *ComponentHandler) GetVulnerableComponents(c *gin.Context)

func (*ComponentHandler) RegisterRoutes

func (s *ComponentHandler) RegisterRoutes(r *gin.Engine)

type ComponentStore

type ComponentStore struct {
	Analyzer types.Analyzer
	// contains filtered or unexported fields
}

func NewComponentStore

func NewComponentStore(db *mongo.Database, analyzer types.Analyzer) *ComponentStore

func (*ComponentStore) AddComponentUsingSbom

func (c *ComponentStore) AddComponentUsingSbom(sbom types.Sbom) ([]string, error)

func (*ComponentStore) DeleteById

func (c *ComponentStore) DeleteById(idParam string, param string, duration int) (int64, error)

func (*ComponentStore) DeleteByIds

func (c *ComponentStore) DeleteByIds(idParams []string, param string, duration int) (int64, error)

func (*ComponentStore) GetComponentById

func (c *ComponentStore) GetComponentById(idParam string, duration int) ([]types.Component, error)

Handler for getting paginated items

func (*ComponentStore) GetComponentByName

func (c *ComponentStore) GetComponentByName(name string, duration int) ([]types.Component, error)

func (*ComponentStore) GetComponentTotalCount

func (c *ComponentStore) GetComponentTotalCount(filter interface{}) (int64, error)

func (*ComponentStore) GetComponentsUsingFilter

func (c *ComponentStore) GetComponentsUsingFilter(filter interface{}, page, limit, duration int) ([]types.Component, error)

func (*ComponentStore) GetPaginatedComponents

func (c *ComponentStore) GetPaginatedComponents(page, limit, duration int) ([]types.Component, error)

Handler for getting paginated items

func (*ComponentStore) GetVulnerableComponents

func (c *ComponentStore) GetVulnerableComponents(componentNames, componentVersions, sbomIds, compTypes, compNames, purls, versions []string, page, limit, duration int) (components []types.Component, total int64, err error)

func (*ComponentStore) GetVulnerableSbomComponentsFilter

func (c *ComponentStore) GetVulnerableSbomComponentsFilter(componentNames, componentVersions, sbomIds, compTypes, compNames, purls, versions []string, page, limit int) bson.M

func (*ComponentStore) IsSbomProcessed

func (c *ComponentStore) IsSbomProcessed(sbomId string) bool

Jump to

Keyboard shortcuts

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