Documentation ¶
Overview ¶
Package csv provides a CSV parser for k6.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModuleInstance ¶
type ModuleInstance struct { *RootModule // contains filtered or unexported fields }
ModuleInstance represents an instance of the fs module for a single VU.
func (*ModuleInstance) Exports ¶
func (mi *ModuleInstance) Exports() modules.Exports
Exports implements the modules.Module interface and returns the exports of our module.
func (*ModuleInstance) NewParser ¶
func (mi *ModuleInstance) NewParser(call sobek.ConstructorCall) *sobek.Object
NewParser creates a new CSV parser instance.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a CSV parser.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a CSV reader.
It wraps a csv.Reader and provides additional functionality such as the ability to stop reading at a specific line.
func NewReaderFrom ¶
NewReaderFrom creates a new CSV reader from the provided io.Reader.
It will check whether the first line should be skipped and consume it if necessary. It will also check whether the reader should start from a specific line and skip lines until that line is reached. We perform these operations here to avoid having to do them in the Read method.
Hence, this constructor function can return an error if the first line cannot be skipped or if the reader cannot start from the specified line.
type RootModule ¶
type RootModule struct {
// contains filtered or unexported fields
}
RootModule is the global module instance that will create instances of our module for each VU.
func (*RootModule) NewModuleInstance ¶
func (rm *RootModule) NewModuleInstance(vu modules.VU) modules.Instance
NewModuleInstance implements the modules.Module interface and returns a new instance of our module for the given VU.