dirparser

package module
v0.0.0-...-94234f9 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 4 Imported by: 0

README

dirparser

This simple recursive parser for parsing csv or looks-like-csv files. Written for internal use.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePath

func ParsePath(path string, p Parser) error

ParsePath parse using Parse Interface

func ProcessFile

func ProcessFile(path string, p Processor) error

ProcessFile process a single file

func ProcessPath

func ProcessPath(path string, p Processor) error

ProcessPath for parse path

Types

type Parser

type Parser interface {
	Init(io.Reader, string) (Reader, error)
	Parse([]string) error
	Close() error
}

Parser for implement real parser

type Processor

type Processor interface {
	Process(filename string) error
}

Processor just recursive walk on file tree

type Reader

type Reader interface {
	Read() ([]string, error)
}

Reader interface compilant with csv.Reader to use it with csv

func NewDeepReader

func NewDeepReader(r io.Reader, separator string) Reader

NewDeepReader returns multibyteCSV-like reader

Jump to

Keyboard shortcuts

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