Documentation ¶
Overview ¶
Package base implements core libraries used in multiple Moov projects. Refer to each projects documentation for more details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorList ¶ added in v0.3.0
type ErrorList []error
ErrorList represents an array of errors which is also an error itself.
func (*ErrorList) Add ¶ added in v0.3.0
Add appends err onto the ErrorList. Errors are kept in append order.
func (ErrorList) MarshalJSON ¶ added in v0.3.0
MarshalJSON marshals error list
type ParseError ¶ added in v0.3.0
type ParseError struct { Line int // Line number where the error occurred Record string // Name of the record type being parsed Err error // The actual error }
ParseError is returned for parsing reader errors. The first line is 1.
func (ParseError) Error ¶ added in v0.3.0
func (e ParseError) Error() string
type Time ¶
Time is an time.Time struct that encodes and decodes in ISO 8601.
ISO 8601 is usable by a large array of libraries whereas RFC 3339 support isn't often part of language standard libraries.
Time also assists in calculating processing days that meet the US Federal Reserve Banks processing days.
For holidays falling on Saturday, Federal Reserve Banks and Branches will be open the preceding Friday. For holidays falling on Sunday, all Federal Reserve Banks and Branches will be closed the following Monday. ACH and FedWire payments are not processed on weekends or the following US holidays.
Holiday Schedule: https://www.frbservices.org/holidayschedules/
All logic is based on ET(Eastern) time as defined by the Federal Reserve https://www.frbservices.org/operations/fedwire/fedwire_hours.html
func NewTime ¶
NewTime wraps a time.Time value in Moov's base.Time struct. If you need the underlying time.Time value call .Time:
The time zone will be changed to DefaultLocation.
now := Now() fmt.Println(start.Sub(now.Time))
func Now ¶
func Now() Time
Now returns a Time object with the current clock time set. By default, America/New_York will be the chosen time zone.
func (Time) AddBankingDay ¶ added in v0.2.0
AddBankingDay takes an integer for the number of valid banking days to add and returns a Time
func (Time) Equal ¶
Equal compares two Time values. Time values are considered equal if they both truncate to the same year/month/day and hour/minute/second.
func (Time) IsBankingDay ¶ added in v0.2.0
IsBankingDay checks the rules around holidays (i.e. weekends) to determine if the given day is a banking day.
func (Time) IsWeekend ¶ added in v0.2.0
IsWeekend reports whether the given date falls on a weekend.
func (Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
Directories ¶
Path | Synopsis |
---|---|
Package admin implements an http.Server which can be used for operations and monitoring tools.
|
Package admin implements an http.Server which can be used for operations and monitoring tools. |
Package http implements a core suite of HTTP functions for use inside Moov.
|
Package http implements a core suite of HTTP functions for use inside Moov. |
bind
Package bind returns well known HTTP local bind addresses for Moov services.
|
Package bind returns well known HTTP local bind addresses for Moov services. |
lru
lru is a simple inmemory Recorder implementation.
|
lru is a simple inmemory Recorder implementation. |