amscli

package module
v0.0.0-...-2b81bf9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 11 Imported by: 0

README

xk6-cli-wrapper

A k6 extension for wrapping CLI app

Build

To build a k6 binary with this plugin, first ensure you have the prerequisites:

Then:

  1. Install xk6:
go install github.com/k6io/xk6/cmd/xk6@latest
  1. Build the binary:
xk6 build master \
  --with github.com/nanang-ab/xk6-cli-wrapper

Example

Please refer the sample k6 script

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIWrapper

type CLIWrapper struct {
}

func (*CLIWrapper) CleanupCLI

func (c *CLIWrapper) CleanupCLI(cliPath string) error

CleanupCLI removes the downloaded CLI tool.

func (*CLIWrapper) DownloadCLIFile

func (c *CLIWrapper) DownloadCLIFile(url, dir string) (string, error)

func (*CLIWrapper) ExecuteCommand

func (c *CLIWrapper) ExecuteCommand(cliPath string, args ...string) (string, error)

ExecuteCommand runs the specified CLIWrapper command with arguments and returns its output

func (*CLIWrapper) GetAbsolutePath

func (c *CLIWrapper) GetAbsolutePath(cliPath string) (string, error)

func (*CLIWrapper) GetWritableDirectory

func (c *CLIWrapper) GetWritableDirectory(baseDirectory string) string

GetWritableDirectory attempts to find a writable directory, defaults to the system temp directory if specified directory is not writable.

func (*CLIWrapper) ValidateCLIFileHash

func (c *CLIWrapper) ValidateCLIFileHash(cliPath, expectedHash string) (bool, error)

Jump to

Keyboard shortcuts

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