dataparser

package
v0.0.0-...-1869de2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(filename string) (*os.File, error)

Read open a file by it's name and returns a pointer to a os.File struct, or it returns an error if the file can't be open or read

Types

type Product

type Product struct {
	Name     string
	Category string
	Desc     string
	Image    string
}

Product is the definition of a online store product for ingestion into the online store

func CSV

func CSV(f *os.File, hasHeader bool) ([]Product, error)

CSV parses a comma separated values file into a slice of Product structs

func File

func File(f *os.File) (Product, error)

File parse a single product file into a product struct

Jump to

Keyboard shortcuts

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