repeatconfig

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package repeatconfig provides a utility for applying the RepeatConfig proto to config checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRepeatConfigToFile

func ApplyRepeatConfigToFile(fileSet *ipb.FileSet, config *RepeatConfig) *ipb.FileSet

ApplyRepeatConfigToFile applies the substitutions in the given repeat config to the given FileSet. The returned FileSet proto is a copy of the original.

func ApplyRepeatConfigToInstruction

func ApplyRepeatConfigToInstruction(instruction *ipb.FileCheck, config *RepeatConfig) *ipb.FileCheck

ApplyRepeatConfigToInstruction applies the substitutions in the given repeat config to the given instruction. The returned instruction proto is a copy of the original.

Types

type RepeatConfig

type RepeatConfig struct {
	TokenReplacements []*TokenReplacement
	Err               error
}

RepeatConfig is a single repeat config that specifies what tokens to replace in the files/instructions in this iteration of the check.

func CreateRepeatConfigs

func CreateRepeatConfigs(ctx context.Context, repeatOptions *ipb.RepeatConfig, fs scanapi.Filesystem) ([]*RepeatConfig, error)

CreateRepeatConfigs creates a list of configs with the appropriate token substitutions based on the supplied repeat config enum.

type TokenReplacement

type TokenReplacement struct {
	TextToReplace string
	ReplaceWith   string
}

TokenReplacement describes a single token to replace.

Jump to

Keyboard shortcuts

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