repo2cpe

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MappingFile

type MappingFile struct {
	Data map[string]Repo `json:"data"`
}

MappingFile is a data struct for mapping file between repositories and CPEs

func (*MappingFile) Get

func (m *MappingFile) Get(ctx context.Context, rs []string) ([]string, error)

type Repo

type Repo struct {
	CPEs []string `json:"cpes"`
}

Repo structure holds information about CPEs for given repo

type UpdatingMapper

type UpdatingMapper struct {
	URL    string
	Client *http.Client
	// contains filtered or unexported fields
}

UpdatingMapper provides local repo -> cpe mapping via a continually updated local mapping file

func NewUpdatingMapper

func NewUpdatingMapper(client *http.Client, url string, init *MappingFile) *UpdatingMapper

NewUpdatingMapper returns an UpdatingMapper.

func (*UpdatingMapper) Fetch

func (u *UpdatingMapper) Fetch(ctx context.Context) error

func (*UpdatingMapper) Get

func (u *UpdatingMapper) Get(ctx context.Context, rs []string) ([]string, error)

Get translates repositories into CPEs using a mapping file.

Get is safe for concurrent usage.

Jump to

Keyboard shortcuts

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