Documentation
¶
Index ¶
Constants ¶
const ( FundsType0 = "0" FundsType1 = "1" FundsType2 = "2" FundsTypeS = "S" FundsTypeV = "V" FundsTypeD = "D" FundsTypeZ = "Z" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.2.0
type Account struct {
// Account Identifier
AccountNumber string `json:"accountNumber"`
CurrencyCode string `json:"currencyCode,omitempty"`
Summaries []AccountSummary `json:"summaries,omitempty"`
// Account Trailer
AccountControlTotal string `json:"accountControlTotal"`
NumberRecords int64 `json:"numberRecords"`
Details []Detail
// contains filtered or unexported fields
}
Account Format
func (*Account) Read ¶ added in v0.2.0
func (r *Account) Read(scan *Bai2Scanner, useCurrentLine bool) error
func (*Account) SumDetailAmounts ¶ added in v0.3.0
Sums the Amount fields from all 03 and 16 records. Maps to the AccountControlTotal field
func (*Account) SumRecords ¶ added in v0.3.0
Sums the number of 03,16,88,49 records in the account. Maps to the NumberRecords field
type AccountSummary ¶ added in v0.2.0
type Bai2 ¶ added in v0.2.0
type Bai2 struct {
// File Header
Sender string `json:"sender"`
Receiver string `json:"receiver"`
FileCreatedDate string `json:"fileCreatedDate"`
FileCreatedTime string `json:"fileCreatedTime"`
FileIdNumber string `json:"fileIdNumber"`
PhysicalRecordLength int64 `json:"physicalRecordLength,omitempty"`
BlockSize int64 `json:"blockSize,omitempty"`
VersionNumber int64 `json:"versionNumber"`
// File trailer
FileControlTotal string `json:"fileControlTotal"`
NumberOfGroups int64 `json:"numberOfGroups"`
NumberOfRecords int64 `json:"numberOfRecords"`
// Groups
Groups []Group
// contains filtered or unexported fields
}
FILE with BAI Format
func NewBai2 ¶ added in v0.2.0
func NewBai2() *Bai2
NewBai2With returns a BAI2 file with the default options
func NewBai2With ¶ added in v0.4.0
NewBai2With returns a BAI2 file with the specified options
func (*Bai2) Read ¶ added in v0.2.0
func (r *Bai2) Read(scan *Bai2Scanner) error
func (*Bai2) SetOptions ¶ added in v0.4.0
func (*Bai2) SumGroupControlTotals ¶ added in v0.3.0
Sums the Group Control Totals. Maps to the FileControlTotal field.
func (*Bai2) SumNumberOfGroups ¶ added in v0.3.0
Sums the number of groups. Maps to the NumberOfGroups field.
func (*Bai2) SumRecords ¶ added in v0.3.0
Sums the groups NumberOfRecords plus file header and trailer. Maps to the NumberOfRecords field.
type Bai2Scanner ¶ added in v0.2.0
type Bai2Scanner struct {
// contains filtered or unexported fields
}
func NewBai2Scanner ¶ added in v0.2.0
func NewBai2Scanner(fd io.Reader) Bai2Scanner
func (*Bai2Scanner) GetLine ¶ added in v0.2.0
func (b *Bai2Scanner) GetLine() string
func (*Bai2Scanner) GetLineIndex ¶ added in v0.2.0
func (b *Bai2Scanner) GetLineIndex() int
func (*Bai2Scanner) ScanLine ¶ added in v0.2.0
func (b *Bai2Scanner) ScanLine(arg ...bool) string
ScanLine returns a line from the underlying reader arg[0]: useCurrentLine (if false read a new line)
type Detail ¶ added in v0.2.0
type Detail transactionDetail
Detail Format
type Distribution ¶ added in v0.2.0
type FundsType ¶ added in v0.2.0
type FundsType struct {
TypeCode FundsTypeCode `json:"type_code,omitempty"`
// Type 0,1,2,S
ImmediateAmount int64 `json:"immediate_amount,omitempty"` // availability amount
OneDayAmount int64 `json:"one_day_amount,omitempty"` // one-day availability amount
TwoDayAmount int64 `json:"two_day_amount,omitempty"` // more than one-day availability amount
// Type V
Date string `json:"date,omitempty"`
Time string `json:"time,omitempty"`
// Type D
DistributionNumber int64 `json:"distribution_number,omitempty"`
Distributions []Distribution `json:"distributions,omitempty"`
}
type FundsTypeCode ¶ added in v0.2.0
type FundsTypeCode string
func (FundsTypeCode) Validate ¶ added in v0.2.0
func (c FundsTypeCode) Validate() error
type Group ¶ added in v0.2.0
type Group struct {
// Group Header
Receiver string `json:"receiver,omitempty"`
Originator string `json:"originator"`
GroupStatus int64 `json:"groupStatus"`
AsOfDate string `json:"asOfDate"`
AsOfTime string `json:"asOfTime,omitempty"`
CurrencyCode string `json:"currencyCode,omitempty"`
AsOfDateModifier int64 `json:"asOfDateModifier,omitempty"`
// Group Trailer
GroupControlTotal string `json:"groupControlTotal"`
NumberOfAccounts int64 `json:"numberOfAccounts"`
NumberOfRecords int64 `json:"numberOfRecords"`
Accounts []Account
// contains filtered or unexported fields
}
Group Format
func (*Group) Read ¶ added in v0.2.0
func (r *Group) Read(scan *Bai2Scanner, useCurrentLine bool) error
func (*Group) SumAccountControlTotals ¶ added in v0.3.0
Sums the account control totals in the group. Maps to the GroupControlTotal field
func (*Group) SumNumberOfAccounts ¶ added in v0.3.0
Sums the number of accounts in the group. Maps to the NumberOfAccounts field
func (*Group) SumRecords ¶ added in v0.3.0
Sums the number of 02,03,16,88,49,98 records in the group. Maps to the NumberOfRecords field