ciface: github.com/npolar/ciface Index | Files

package ciface

import "github.com/npolar/ciface"

Index

Package Files

ciface.go

func BooleanString Uses

func BooleanString(s string) bool

BooleanString is used to detect if a string contains a boolean value

func Round Uses

func Round(number float64, p int64) float64

Round is used to round numbers to a certain precision

type CsvInterface Uses

type CsvInterface struct {
    Reader    *csv.Reader
    Data      []byte   // Raw csv data
    Header    []string // Custom header
    Precision int64    // Decimal precision when converting numbers
    Skip      int      // Number of lines to skip before parsing
}

CsvInterface is a structure describing the structure of the parser. Structure is in line with that of the standard libraries Csv parser.

func NewParser Uses

func NewParser(data []byte) *CsvInterface

NewParser is used to initialize a new CsvInterface with data Other settings should be applied directly to the new object

func (*CsvInterface) LineConverter Uses

func (cif *CsvInterface) LineConverter(line []string) (interface{}, error)

LineConverter processes the csv line data to the proper json types and returns the resulting data structure as a map[string]interface{} (golang json structure).

func (*CsvInterface) Parse Uses

func (cif *CsvInterface) Parse() ([]interface{}, error)

Parse takes the CsvInterface struct and parses the []byte data to an []interface{}

Package ciface imports 6 packages (graph) and is imported by 1 packages. Updated 2016-07-22. Refresh now. Tools for package owners.