extensions

package
v1.4.2-rc6 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

Adding new extensions

As new requirements come and build time extensions need to be added, there are a few things that you have to make sure are present before commiting :

  • files that should be included in the binary only with a specific extension must contain the following syntax at the beginning of the file :

//go:build sync will be added automatically by the linter, so only the second line is mandatory .

NOTE: the third line in the example should be blank, otherwise the build tag would be just another comment.

//go:build sync
// +build sync

package extensions
...................
  • when adding a new tag, specify the new order in which multiple tags should be used (bottom of this page)

  • for each and every new file that contains functions (functionalities) specific to an extension, one should create a corresponding file that must contain the exact same functions, but no functionalities included. This file must begin with an "anti-tag" (e.g. // +build !sync) which will include this file in binaries that don't include this extension ( in this example, the file won't be used in binaries that include sync extension ). See extension-sync-disabled.go for an example.

  • when a new extension comes out, the developer should also write some blackbox tests, where a binary that contains the new extension should be tested in a real usage scenario. See test/blackbox folder for multiple extensions examples.

  • newly added blackbox tests should have targets in Makefile. You should also add them as Github Workflows, in .github/workflows/ecosystem-tools.yaml

  • with every new extension, you should modify the EXTENSIONS variable in Makefile by adding the new extension. The EXTENSIONS variable represents all extensions and is used in Make targets that require them all (e.g make test).

  • the available extensions that can be used at the moment are: sync, scrub, metrics, search, ui_base . NOTE: When multiple extensions are used, they should be enlisted in the above presented order.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableMetricsExtension

func EnableMetricsExtension(config *config.Config, log log.Logger, rootDir string)

EnableMetricsExtension ...

func EnableScrubExtension

func EnableScrubExtension(config *config.Config,
	log log.Logger, run bool,
	imgStore storage.ImageStore, repo string,
)

EnableScrubExtension ...

func EnableSearchExtension

func EnableSearchExtension(config *config.Config, log log.Logger, rootDir string)

EnableSearchExtension ...

func EnableSyncExtension

func EnableSyncExtension(ctx context.Context,
	config *config.Config, wg *goSync.WaitGroup,
	storeController storage.StoreController, log log.Logger,
)

EnableSyncExtension ...

func GetExtensions

func GetExtensions(config *config.Config) distext.ExtensionList

GetExtensions...

func GetLinter

func GetLinter(config *config.Config, log log.Logger) *lint.Linter

func SetupMetricsRoutes

func SetupMetricsRoutes(conf *config.Config, router *mux.Router,
	storeController storage.StoreController, log log.Logger,
)

SetupMetricsRoutes ...

func SetupSearchRoutes

func SetupSearchRoutes(conf *config.Config, router *mux.Router,
	storeController storage.StoreController, log log.Logger,
)

SetupSearchRoutes ...

func SyncOneImage

func SyncOneImage(config *config.Config, storeController storage.StoreController,
	repoName, reference string, isArtifact bool, log log.Logger,
) error

SyncOneImage ...

Types

This section is empty.

Directories

Path Synopsis
nolint: varnamelen,forcetypeassert
nolint: varnamelen,forcetypeassert
common
Package common ...
Package common ...
cve
Package cveinfo ...
Package cveinfo ...

Jump to

Keyboard shortcuts

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