libcsv

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 9 Imported by: 0

README

libcsv

Documentation

Overview

Copyright (c) 2022 Alexandru Catrina

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	HEADER_A_SENDER   byte = 'a'
	HEADER_B_RECEIVER byte = 'b'
	HEADER_C_CATEGORY byte = 'c'
	HEADER_D_DATE     byte = 'd'
	HEADER_S_SUM      byte = 's'
	HEADER_X_ANYONE   byte = 'x' // hidden header, "either sender or receiver" is ORing trx party
	HEADER_0_BALANCE  byte = 'z' // hidden header, "by reference to zero" is positive or negative
)
View Source
const (
	OPERATOR_EQUAL_MATCH  byte = '='
	OPERATOR_GREATER_THAN byte = '>'
	OPERATOR_LESS_THAN    byte = '<'
)

Variables

View Source
var (
	OPT_MAX_READ    int64  = 1 << 20
	OPT_DATE_LAYOUT string = "2006-01-02"
	OPT_SEPARATOR   string = "+"
)

Functions

func Setup

func Setup(lc *Locale)

Types

type Collection

type Collection []Record

func New

func New(src io.Reader) Collection

func (Collection) Filter

func (c Collection) Filter(q string) (results Collection, err error)

type Locale

type Locale struct {
	Months  []string
	Unicode map[string]string
}

func (*Locale) Month

func (lc *Locale) Month(monthName string) int

func (*Locale) Translate

func (lc *Locale) Translate(text string) string

type Record

type Record struct {
	Sender   string
	Receiver string
	Label    string
	Date     time.Time
	Amount   int64 // sum
}

func (Record) String

func (r Record) String() string

Jump to

Keyboard shortcuts

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