distertaskproviderinternal

package
v1.104.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisterConfigYAMLFlagName         = "dister-config-yml"
	AllProductTaskOutputInfoFlagName = "all-product-task-output-info"
)

Variables

This section is empty.

Functions

func NewTaskProviderCommand

func NewTaskProviderCommand(name, short string, runner distertaskproviderapi.TaskRunner) *cobra.Command

NewTaskProviderCommand returns a new *cobra.Command with the provided name and description that runs the provided TaskRunner for the dister with the provided name. The command is configured with the DisterConfigYAMLFlagName and AllProductTaskOutputInfoFlagName flags and handles the translation from the flag values to the typed values passed to the RunTask function.

func RunDisterTaskProviderAssetCommand

func RunDisterTaskProviderAssetCommand(
	assetPath string,
	cmdArgs []string,
	disterConfigYAML ProductsDisterConfig,
	allProductTaskOutputInfos map[distgo.ProductID]distgo.ProductTaskOutputInfo,
	providedArgs []string,
	stdout,
	stderr io.Writer,
) error

RunDisterTaskProviderAssetCommand runs a dister TaskProvider task provided by an asset. Invokes the asset at the provided assetPath with cmdArgs, the flags DisterConfigYAMLFlagName and AllProductTaskOutputInfoFlagName with their respective values (which are files that have the content of the provided allConfigYML and allProductTaskOutputInfos arguments marshalled as YAML), and providedArgs, and uses the provided stdout and stderr writers as stdout and stderr. Any flags that control behavior for things like global flags or verify mode should be included as values in the providedArgs parameter.

Types

type ProductsDisterConfig

ProductsDisterConfig stores the YAML configuration for disters. It is represented as a map from ProductID to DistID to DisterConfigYAML.

func FilterDisterConfigYAML

func FilterDisterConfigYAML(allConfigYAML ProductsDisterConfig, disterName string) ProductsDisterConfig

FilterDisterConfigYAML returns a new map that contains only the entries in the input map where the config DisterName field is equal to the provided disterName. The returned map only includes ProductID keys for values that have at least 1 dister entry. The returned map has its own new copies of the inner maps. The config values are shallow copies (the byte slice for config is not cloned).

Jump to

Keyboard shortcuts

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