ddataset: github.com/lawrencewoodman/ddataset/dcsv Index | Files

package dcsv

import "github.com/lawrencewoodman/ddataset/dcsv"

Package dcsv handles access to a CSV file as Dataset


Package Files


func New Uses

func New(
    filename string,
    hasHeader bool,
    separator rune,
    fieldNames []string,
) ddataset.Dataset

New creates a new DCSV Dataset

type DCSV Uses

type DCSV struct {
    // contains filtered or unexported fields

DCSV represents a CSV file Dataset

func (*DCSV) Fields Uses

func (d *DCSV) Fields() []string

Fields returns the field names used by the Dataset

func (*DCSV) NumRecords Uses

func (d *DCSV) NumRecords() int64

NumRecords returns the number of records in the Dataset. If there is a problem getting the number of records it returns -1. NOTE: The returned value can change if the underlying Dataset changes.

func (*DCSV) Open Uses

func (d *DCSV) Open() (ddataset.Conn, error)

Open creates a connection to the Dataset

func (*DCSV) Release Uses

func (d *DCSV) Release() error

Release releases any resources associated with the Dataset d, rendering it unusable in the future.

type DCSVConn Uses

type DCSVConn struct {
    // contains filtered or unexported fields

DCSVConn represents a connection to a DCSV Dataset

func (*DCSVConn) Close Uses

func (c *DCSVConn) Close() error

Close closes the connection

func (*DCSVConn) Err Uses

func (c *DCSVConn) Err() error

Err returns any errors from the connection

func (*DCSVConn) Next Uses

func (c *DCSVConn) Next() bool

Next returns whether there is a Record to be Read

func (*DCSVConn) Read Uses

func (c *DCSVConn) Read() ddataset.Record

Read returns the current Record

Package dcsv imports 6 packages (graph) and is imported by 2 packages. Updated 2018-01-12. Refresh now. Tools for package owners.