Finch Docs
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Data

Implement data.Generator:

type Generator interface {
    Format() (uint, string)
    Copy() Generator
    Values(RunCount) []interface{}
    Scan(any interface{}) error
    Name() string
}

Your generator does not have to handle data scope. When it’s called, Finch expects new values.

Implement data.Factory to create your data generator:

type Factory interface {
    Make(name, dataKey string, params map[string]string) (Generator, error)
}

Register your data generator and its factory by calling data.Register(name string, f Factory) error.