Documentation
¶
Index ¶
- func AddCommandOutput(ctx context.Context, opts AddCommandOutputOptions)
- func AddFailureOutput(outputPath string, command string, err error)
- func AddHttpOutput(opts AddHttpOutputOptions)
- func AddJsonOutput(opts AddJsonOutputOptions)
- func AddOutputDirectory(cfg *config.Config)
- func CreateFile(path string) (*os.File, error)
- func DoHttp(options HttpOptions) ([]byte, error)
- func DownloadOutput(opts DownloadOptions)
- func WriteToFile(path string, content []byte)
- func ZipOutputDirectory(cfg *config.Config) string
- type AddCommandOutputOptions
- type AddHttpOutputOptions
- type AddJsonOutputOptions
- type DownloadOptions
- type HttpOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandOutput ¶
func AddCommandOutput(ctx context.Context, opts AddCommandOutputOptions)
AddCommandOutput opts.OutputPath must include a %d to replace the execution number when opts.Executions > 1
func AddFailureOutput ¶ added in v1.4.0
AddFailureOutput records a collection step that could not be executed at all, so that the archive says why instead of leaving the file empty or absent.
func AddHttpOutput ¶ added in v1.1.2
func AddHttpOutput(opts AddHttpOutputOptions)
func AddJsonOutput ¶
func AddJsonOutput(opts AddJsonOutputOptions)
func AddOutputDirectory ¶
func CreateFile ¶ added in v1.4.0
CreateFile creates the file and all missing parent directories.
func DoHttp ¶ added in v1.1.2
func DoHttp(options HttpOptions) ([]byte, error)
DoHttp reads the response into memory for callers that need to parse it. Use AddHttpOutput for responses that only end up in a file.
Unlike AddHttpOutput this takes no limit.Commands slot, and it must not: its callers crawl an extension while holding the port-forward the request goes through, and AddHttpOutput already holds a slot when it reaches doHttpRequest - acquiring one further down would nest the semaphore under itself and deadlock as soon as every slot is held by a caller waiting for the inner one. Concurrency here is bounded one level up, by limit.Items.
func DownloadOutput ¶ added in v1.1.2
func DownloadOutput(opts DownloadOptions)
func WriteToFile ¶
func ZipOutputDirectory ¶
Types ¶
type AddCommandOutputOptions ¶
type AddCommandOutputOptions struct {
Config *config.Config
CommandName string
CommandArgs []string
OutputPath string
Executions int
DelayBetweenExecutions *time.Duration
ExecutionContext string
LogError bool
// Notes are recorded in the output file, for what the reader has to know to interpret it
Notes []string
// Timeout limits a single execution, starting once it acquired an execution slot. Zero means no limit.
Timeout time.Duration
}