moldova: github.com/StabbyCutyou/moldova Index | Files | Directories

package moldova

import "github.com/StabbyCutyou/moldova"

Package moldova is a lightweight generator of random data, based on a provided template. It supports a number of tokens which will be replaced with random values, based on the type and arguments of each token.

Index

Package Files

errors.go moldova.go

type Callstack Uses

type Callstack struct {
    // contains filtered or unexported fields
}

Callstack is a list of closures to invoke in order to generate the result of a parsed template. Callstack is a FIFO implementation, making it more akin to a queue than a stack.

func BuildCallstack Uses

func BuildCallstack(inputTemplate string) (*Callstack, error)

BuildCallstack will parse the template, and return a callstack of closures to invoke in order, which will produce static/random values that can be turned into a string

func (*Callstack) Push Uses

func (c *Callstack) Push(t tokenWriter)

Push will place the given tokenWriter function onto the stack. The first function placed onto the stack will be the first one called when Write is called

func (*Callstack) Write Uses

func (c *Callstack) Write(result *bytes.Buffer) error

Write will take a bytes.Buffer pointer and fill it with the results of calling each known function on the Callstack.

type InvalidArgumentError Uses

type InvalidArgumentError string

InvalidArgumentError is returned from the parser when it encounters an invalid argument to a known token

func (InvalidArgumentError) Error Uses

func (e InvalidArgumentError) Error() string

Error implmenets the error interface

type UnsupportedTokenError Uses

type UnsupportedTokenError string

UnsupportedTokenError is returned from the parser when it encounters an unknown token

func (UnsupportedTokenError) Error Uses

func (e UnsupportedTokenError) Error() string

Error implmenets the error interface

Directories

PathSynopsis
csvutilPackage csvutil is used by me to help quickly turn spreadsheets of data and print them as a specific go struct.
data

Package moldova imports 10 packages (graph). Updated 2017-09-09. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).