fednow

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddError

func AddError(errs *base.ErrorList, fieldName string, err error)

func Eastern

func Eastern() *time.Location

Eastern returns a *time.Location for the US Eastern region. RTP requires all timestamps are in this location.

func MarshalISODate

func MarshalISODate(t ISODate) string

func MarshalISODateTime

func MarshalISODateTime(t ISODateTime) string

func ValidateEnumeration

func ValidateEnumeration(value string, enumeration ...string) error

func ValidateFractionDigits

func ValidateFractionDigits(value string, maxValue int) error

func ValidateLength

func ValidateLength(value string, length int) error

func ValidateMaxExclusive

func ValidateMaxExclusive(value int, maxValue int) error

func ValidateMaxInclusive

func ValidateMaxInclusive(value int, maxValue int) error

func ValidateMaxLength

func ValidateMaxLength(value string, maxLength int) error

func ValidateMinExclusive

func ValidateMinExclusive(value int, minValue int) error

func ValidateMinInclusive

func ValidateMinInclusive(value float64, minValue float64) error

func ValidateMinLength

func ValidateMinLength(value string, minLength int) error

func ValidatePattern

func ValidatePattern(value string, regex string) error

func ValidateTotalDigits

func ValidateTotalDigits(value string, maxValue int) error

Types

type Amount

type Amount float64

func (Amount) MarshalText

func (a Amount) MarshalText() ([]byte, error)

func (Amount) Validate

func (a Amount) Validate() error

type ErrorCode

type ErrorCode struct {
	Code        string
	Description string
	Level       ErrorLevel
}

func IsError

func IsError(code string) *ErrorCode

type ErrorLevel

type ErrorLevel string
const (
	// ErrAccountFatal indicates a problem with the (Creditor) account.
	// It likely should be reverified.
	ErrAccountFatal ErrorLevel = "Fatal error for the Account"

	// ErrFatal indicates a problem that likely requires a human be notified.
	ErrFatal ErrorLevel = "Fatal error"

	// ErrTemporary indicates a problem which should go away with time.
	ErrTemporary ErrorLevel = "Temporary"

	// ErrNetwork indicates a problem with the network / connection.
	ErrNetwork ErrorLevel = "Network issue"

	// ErrLogic indicates a bug to fix or work around.
	ErrLogic ErrorLevel = "Logic Bug"
)

func (ErrorLevel) Error

func (e ErrorLevel) Error() string

type ISODate

type ISODate civil.Date

func UnmarshalISODate

func UnmarshalISODate(text string) ISODate

func (ISODate) MarshalText

func (t ISODate) MarshalText() ([]byte, error)

func (*ISODate) UnmarshalText

func (t *ISODate) UnmarshalText(text []byte) error

func (ISODate) Validate

func (t ISODate) Validate() error

type ISODateTime

type ISODateTime time.Time

func UnmarshalISODateTime

func UnmarshalISODateTime(text string) ISODateTime

func (ISODateTime) MarshalText

func (t ISODateTime) MarshalText() ([]byte, error)

func (*ISODateTime) UnmarshalText

func (t *ISODateTime) UnmarshalText(text []byte) error

func (ISODateTime) Validate

func (t ISODateTime) Validate() error

Jump to

Keyboard shortcuts

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