A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://godoc.org/github.com/moov-io/base below:

base package - github.com/moov-io/base - Go Packages

Package base implements core libraries used in multiple Moov projects. Refer to each projects documentation for more details.

View Source
const (
	
	ISO8601Format = "2006-01-02T15:04:05Z07:00"
)

Has takes in a (potential) list of errors, and an error to check for. If any of the errors in the list have the same type as the error to check, it returns true. If the "list" isn't actually a list (typically because it is nil), or no errors in the list match the other error it returns false. So it can be used as an easy way to check for a particular kind of error.

ID creates a new random string for Moov systems. Do not assume anything about these ID's other than they are non-empty strings.

Match takes in two errors and compares them, returning true if they match and false if they don't The matching is done by basic equality for simple errors (i.e. defined by errors.New) and by type for other errors. If errA is wrapped with an error supporting the UnwrappableError interface it will also unwrap it and then recursively compare the unwrapped error with errB.

ErrorList represents an array of errors which is also an error itself.

Add appends err onto the ErrorList. Errors are kept in append order.

Empty no errors to return

Err returns the first error (or nil).

Error implements the error interface

MarshalJSON marshals error list

Print formats the ErrorList into a string written to w. If ErrorList contains multiple errors those after the first are indented.

ParseError is returned for parsing reader errors. The first line is 1.

Unwrap implements the UnwrappableError interface for ParseError

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/about/holiday-schedules

All logic is based on ET(Eastern) time as defined by the Federal Reserve https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html

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 UTC.

Now returns a Time object with the current clock time set.

AddBankingDay takes an integer for the number of valid banking days to add and returns a Time. Negative values and large values (over 500 days) will not modify the Time.

func (t Time) AddBankingTime(hours, minutes, seconds int) Time

AddBankingTime increments t by the hours, minutes, and seconds provided but keeps the final time within 9am to 5pm in t's Location.

AddBusinessDay takes an integer for the number of valid business days to add and returns a Time. Negative values and large values (over 500 days) will not modify the Time.

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 (t Time) GetHoliday() *cal.Holiday

IsBankingDay checks the rules around holidays (i.e. weekends) to determine if the given day is a banking day.

IsWeekend reports whether the given date falls on a weekend.

MarshalJSON returns JSON for the given Time

UnmarshalJSON unpacks a JSON string to populate a Time instance

type UnwrappableError interface {
	Error() string
	Unwrap() error
}

UnwrappableError is an interface for errors that wrap another error with some extra context The interface allows these errors to get automatically unwrapped by the Match function


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4