package
0.0.0-20220623121928-b175f3041c1b
Repository: https://github.com/lf-engineering/da-ds.git
Documentation: pkg.go.dev
# README
Dockerhub Datasource
Dockerhub datasource is a package to fetch data from dockerhub API and save it into Elasticsearch and Enrich saved data.
Docker Running instructions
To run dockerhub datasource from dads you must set proper environment variables to select dockerhub as an engine and other parameters that determine the intended behavior.
These are the needed environment variables to run dockerhub:
- DA_DOCKERHUB_ENRICH={1,0}
- To decide whether will do enrichment step or not.
- DA_DOCKERHUB_ES_URL=http://{ES_USERNAME}:{ES_PASSWORD}@{URL}:{PORT}
- Elasticsearch url included username, password, host and port
- DA_DOCKERHUB_NO_INCREMENTAL={1,0}
- Starts from the beginning if 1 is selected and will not use date to continue enriching
- DA_DOCKERHUB_USERNAME=''
- Optional, for dockerhub repository credentials
- DA_DOCKERHUB_PASSWORD=''
- Optional, for dockerhub repository credentials
- DA_DOCKERHUB_PROJECT_SLUG='{SLUG}'
- Slug name e.g. yocto
- DA_DOCKERHUB_REPOSITORIES_JSON='[{"Owner":'{OWNER}',"Repository":"{REPOSITORY}","Project":"{PROJECT}","ESIndex":"{INDEX_NAME}"}]'
- JSON e.g. '[{"Owner":"crops","Repository":"yocto-eol","Project":"yocto","ESIndex":"sds-yocto-dockerhub"}]'
- DA_DS='{DATASOURCE}'
- Datasource name should be 'dockerhub'
- DA_DOCKERHUB_HTTP_TIMEOUT=60s
- HTTP timeout duration.
Example of running dads at
./scripts/dockerhub.sh
# Packages
No description provided by the author
# Functions
NewEnricher initiates a new Enricher.
NewFetcher initiates a new dockerhub fetcher.
NewManager initiates dockerhub manager instance.
# Constants
APILogin url.
APIRepositories dockerhub repositories API.
APIURL dockerhub base url.
APIVersion dockerhub API version.
Category ...
Dockerhub - DS name.
# Variables
DockerhubRawMapping - Dockerhub raw index mapping.
DockerhubRichMapping - Dockerhub rich index mapping.
DockerhubSearchFields - extra search fields.
# Structs
Aggregations result.
Enricher contains dockerhub datasource enrich logic.
Fetcher contains dockerhub datasource fetch logic.
Hits result.
LastDate result.
LoginResponse from login dockerhub web API.
Manager describes dockerhub manager.
NestedHits result.
Param required for creating a new instance of Bugzilla manager.
Params required parameters for dockerhub fetcher.
Permissions response.
Repository represents dockerhub repository data.
RepositoryEnrich represents dockerhub repository enriched model.
RepositoryRaw represents dockerhub repository raw model.
RepositoryResponse data model represents dockerhub get repository results.
RepositorySearchFields ...
TopHits result.
Total result.
# Interfaces
Auth0Client ...
ESClientProvider used in connecting to ES Client server.
HTTPClientProvider used in connecting to remote http server.