csv

package module
v0.0.0-...-fa5d22b Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

CSV

CSV event driven Hexade project with self contained bus

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadAll = func(fileName string) [][]string {
	file, err := os.Open(fileName)
	if err != nil {
		panic(err)
	}
	defer file.Close()
	data, err := csv.NewReader(file).ReadAll()

	return data
}

Functions

func AddListener

func AddListener(eventListener EventListener)

func NewCSVParser

func NewCSVParser()

func SendEvent

func SendEvent(event Event)

Types

type Event

type Event interface {
}

type EventListener

type EventListener interface {
	OnEvent(eventChannel <-chan Event)
}

type Parser

type Parser struct{}

func (*Parser) OnEvent

func (p *Parser) OnEvent(parserChannel <-chan Event)

type ReadEvent

type ReadEvent interface {
	Event
	FileName() string
	DataModel() any
	ResponseChannel() chan [][]string
}

func NewReadFileEvent

func NewReadFileEvent(fileName string, dataModel any) ReadEvent

Jump to

Keyboard shortcuts

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