vdfile

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

vdfile package provides all different type configuration that vd can run with

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteVDFile

func WriteVDFile(path string, config Config) error

Created TOML config file based on Config

Types

type Config

type Config struct {
	InTerminator  string            `toml:"interm"`
	OutTerminator string            `toml:"outterm"`
	Params        []configParameter `toml:"parameter"`
	Commands      []configCommand   `toml:"command"`
	Mismatch      string            `toml:"mismatch,omitempty"`
}

func DecodeVDFS

func DecodeVDFS(f fs.FS, path string) (Config, error)

Parse TOML file but using fle system FS to Config struct

func DecodeVDFile

func DecodeVDFile(path string) (Config, error)

Parse TOML file to Config struct

func GenerateRandomDelay

func GenerateRandomDelay(config Config) Config

Adds random delays to commands

type VDFile

type VDFile struct {
	InTerminator  []byte
	OutTerminator []byte
	Params        map[string]parameter.Parameter
	Commands      map[string]*command.Command
	Mismatch      []byte
}

VDFile struct

func ReadVDFile

func ReadVDFile(path string) (*VDFile, error)

Read VDFile from disk from the given filepath

func ReadVDFileFromConfig

func ReadVDFileFromConfig(config Config) (*VDFile, error)

Creates vdfile struct based on Config containing result of TOML file parsing

Jump to

Keyboard shortcuts

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