goscon

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 14 Imported by: 0

README

Statement Converter

Go Reference goscon release Go Report Card GitHub go.mod Go version GoDoc reference example GoDoc reference example

Note: Support only HDFC Bank statement files in digital format. JSON is not supported yet. Only PDF to CSV supported.

How to use?

There are 2 ways to use.

  1. Use pre-built binary from here.

  2. Use module by importing github.com/goozt/goscon in your go program.

To get help on running the sample program, use following command.

go run ./sample/main.go help

Documentation

Index

Constants

View Source
const (
	ISTDATETIMEFORMAT = "02/01/2006 15:04:05 -0700"
	ISTDATEFORMAT     = "02/01/2006 -0700"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CliOptions

type CliOptions struct {
	IsBatch bool
	Batch   []string
	File    string
	Dir     string
	Format  string
}

func Cli

func Cli() (*CliOptions, error)

func (*CliOptions) SetFormat

func (c *CliOptions) SetFormat(format string) error

type Statement

type Statement struct {
	Transactions []Transaction
	Opening      float64
	MonthYear    string
}

func Read

func Read(file string) (Statement, error)

func (Statement) FormatedStatement

func (s Statement) FormatedStatement() string

func (Statement) Payment

func (s Statement) Payment() float64

func (Statement) Purchase

func (s Statement) Purchase() float64

func (Statement) ToStrings

func (s Statement) ToStrings() [][]string

func (Statement) TotalDues

func (s Statement) TotalDues() float64

func (Statement) WriteCSV

func (s Statement) WriteCSV(filename string) error

func (Statement) WriteJSON

func (s Statement) WriteJSON() error

type Transaction

type Transaction struct {
	Date        time.Time
	Description string
	Amount      float64
	Credited    bool
}

func (*Transaction) GetTime

func (t *Transaction) GetTime() string

func (*Transaction) SetTime

func (t *Transaction) SetTime(format string, date string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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