Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalUpdaterJob ¶
type LocalUpdaterJob struct { URL string Client *http.Client // contains filtered or unexported fields }
LocalUpdaterJob provides local repo -> cpe mapping via a continually updated local mapping file
func NewLocalUpdaterJob ¶
func NewLocalUpdaterJob(url string, client *http.Client) *LocalUpdaterJob
NewLocalUpdaterJob returns a unstarted UpdaterJob.
func (*LocalUpdaterJob) Get ¶
Get translates repositories into CPEs using a mapping file.
Get is safe for concurrent usage.
func (*LocalUpdaterJob) Start ¶
func (updater *LocalUpdaterJob) Start(ctx context.Context) error
Start begins a local updater job keeping the atomic mapping variable up to date.
Start will block until the first atomic update of the mapping file completes.
All subsequent updates are performed asynchronously in a goroutine.
Canceling the ctx will cancel the updating.
type MappingFile ¶
MappingFile is a data struct for mapping file between repositories and CPEs
type Repo ¶
type Repo struct {
CPEs []string `json:"cpes"`
}
Repo structure holds information about CPEs for given repo
type RepoCPEMapping ¶
type RepoCPEMapping struct {
RepoCPEUpdater
}
RepoCPEMapping struct handles translation of repositories to CPEs
func (*RepoCPEMapping) RepositoryToCPE ¶
func (mapping *RepoCPEMapping) RepositoryToCPE(ctx context.Context, repositories []string) ([]string, error)
RepositoryToCPE translates repositories into CPEs