repo2cpe

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 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 added in v0.4.2

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 added in v0.4.2

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 added in v0.4.2

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

NewUpdatingMapper returns an UpdatingMapper.

func (*UpdatingMapper) Fetch added in v0.4.2

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

func (*UpdatingMapper) Get added in v0.4.2

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