filenio

package module
v0.0.0-...-73d28e8 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

xk6-file

k6 extension for writing files, implemented using the xk6 system.

Build

xk6 build v0.36.0 --with github.com/sealr00t/xk6-filenio@latest

Example

import file from 'k6/x/filenio';

const filepath = 'sample-output.txt';

export default function () {
    file.writeString(filepath, 'New file. First line.\n');
    file.appendString(filepath, `Second line. VU: ${__VU}  -  ITER: ${__ITER}`);
    file.removeLines(filepath, 1, 1);
}

Run sample script

./k6 run sample-script.js

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FILENIO

type FILENIO struct{}

FILENIO is the k6 extension

func (*FILENIO) AppendString

func (*FILENIO) AppendString(path string, s string) error

Append string to file

func (*FILENIO) WriteString

func (*FILENIO) WriteString(path string, s string) error

Write string to file

Jump to

Keyboard shortcuts

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