Documentation ¶
Index ¶
- func AddError(errs *base.ErrorList, fieldName string, err error)
- func AdmnMessageID(ts time.Time, participantID string, serialFunc SerialGenerator) string
- func AlphaSerialNumber(length int) string
- func Arr[T any](v T) []*T
- func BusinessID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
- func CaseAssignmentID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
- func Eastern() *time.Location
- func InstructionID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
- func MarshalISODate(t ISODate) string
- func MarshalISODateTime(t ISODateTime) string
- func MessageID(ts time.Time, participantID string, serial string, ...) string
- func NumericSerialNumber(length int) string
- func Ptr[T any](v T) *T
- func RandomSerial(length int) string
- func TransactionID(ts time.Time, participantID string, serial string, ...) string
- func ValidateEnumeration(value string, enumeration ...string) error
- func ValidateFractionDigits(value string, maxValue int) error
- func ValidateLength(value string, length int) error
- func ValidateMaxExclusive(value int, maxValue int) error
- func ValidateMaxInclusive(value int, maxValue int) error
- func ValidateMaxLength(value string, maxLength int) error
- func ValidateMinExclusive(value int, minValue int) error
- func ValidateMinInclusive(value int, minValue int) error
- func ValidateMinLength(value string, minLength int) error
- func ValidatePattern(value string, regex string) error
- func ValidateTotalDigits(value string, maxValue int) error
- type Amount
- type Cdata
- type ErrorCode
- type ErrorLevel
- type ISODate
- type ISODateTime
- type SerialGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdmnMessageID ¶ added in v0.7.0
func AdmnMessageID(ts time.Time, participantID string, serialFunc SerialGenerator) string
AdmnMessageID generates a Message Identification value.
Format: YYYYMMDDHHMMSSbbbbbbbbbbbXXXXXXXXXX Pos. 01-14 - File creation date in format YYYYMMDDHHMMSS Pos. 15-25 - 11 character Participant Identifier for FIs and TPSP Pos. 26-35 - Participant specific Message serial number (up to 10 characters)
Example: 2016021810064302120020101B61NHTCSG6
func AlphaSerialNumber ¶ added in v0.7.0
AlphaSerialNumber will generate an alphanumeric serial number from the current timestamp
func BusinessID ¶ added in v0.7.0
func BusinessID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
BusinessID generates a Business Message Identifier value.
Format: BYYYYMMDDbbbbbbbbbbbGAAAnnnnnnnnnnn Pos. 01-01 – Prefix ‘B’ Pos. 02-09 - File creation date in format YYYYMMDD Pos. 10-20 - Participant ID (11 characters) Pos. 21-21 - Message generation source (“B” if generated by a TCH FI, "H" generated by RTP) Pos. 22-24 - Discretionary bank field (3 digit alpha numeric that can be used to serialize, identify specific systems, etc.) Pos. 25-35 - Message serial number (11 numeric characters)
Example: B20171112021200201A1BHEA00000000011
func CaseAssignmentID ¶ added in v0.10.0
func CaseAssignmentID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
CaseAssignmentID generates an Assignment Identifier for a Case. This is used in camt.029 responses.
Format: MYYYYMMDDbbbbbbbbbbbBAAAnnnnnnnnnnn Pos. 01-01 – Prefix ‘M’ Pos. 02-09 - File creation date in format YYYYMMDD Pos. 10-20 - Participant ID (11 characters) Pos. 21-21 - Message generation source ("B" if generated by a Participant) Pos. 22-24 - Discretionary bank field (3 digit alpha numeric that can be used to serialize, identify specific systems, etc.) Pos. 25-35 - Message serial number (11 numeric characters)
func Eastern ¶ added in v0.7.0
Eastern returns a *time.Location for the US Eastern region. RTP requires all timestamps are in this location.
func InstructionID ¶ added in v0.7.0
func InstructionID(ts time.Time, participantID, bankField string, serialFunc SerialGenerator) string
InstructionID generates a Instruction Identification value.
Format: YYYYMMDDbbbbbbbbbbbBAAAAnnnnnnnnnnn Pos. 01-08 - File creation date in format YYYYMMDD Pos. 09-19 - Participant ID (11 characters) Pos. 20-20 - Message generation source (“B” if generated by a Participant) Pos. 21-24 - Discretionary bank field (4 digit alpha numeric that can be used to serialize, identify specific systems, etc.) Pos. 25-35 - Message serial number (11 numeric characters)
Example: 2016021812345678901BD61U00000000006
func MarshalISODate ¶ added in v0.8.0
func MarshalISODateTime ¶ added in v0.8.0
func MarshalISODateTime(t ISODateTime) string
func MessageID ¶ added in v0.7.0
func MessageID(ts time.Time, participantID string, serial string, messageSerialFunc SerialGenerator) string
MessageID returns a Message Identification for pacs.008 messages
Format: MYYYYMMDDbbbbbbbbbbbBAAAnnnnnnnnnnn Pos. 01-01 - Prefix "M" Pos. 02-09 - File creation date in format YYYYMMDD Pos. 10-20 - FI Identifier (11 digit Participant ID) Pos. 21-21 - Message generation source ("B" if generated by a TCH FI) Pos. 22-24 - Alphabetic serial identifier (3 alphabetic characters) Pos. 25-35 - Message serial number (11 numeric characters)
Example: M2015111511021200201BFFF00000000001
func NumericSerialNumber ¶ added in v0.7.0
NumericSerialNumber will generate an numeric serial number from the current timestamp
func RandomSerial ¶ added in v0.11.0
RandomSerial will generate an alphanumeric serial number from cryptographic random data
func TransactionID ¶ added in v0.7.0
func TransactionID(ts time.Time, participantID string, serial string, messageSerialFunc SerialGenerator) string
TransactionID
Format: YYYYMMDDbbbbbbbbbbbBRRRRnnnnnnnnnnn Example: 2015111502120020101BCPAA00000000001
func ValidateEnumeration ¶ added in v0.8.0
func ValidateFractionDigits ¶ added in v0.8.0
func ValidateLength ¶ added in v0.8.0
func ValidateMaxExclusive ¶ added in v0.8.0
func ValidateMaxInclusive ¶ added in v0.8.0
func ValidateMaxLength ¶ added in v0.8.0
func ValidateMinExclusive ¶ added in v0.8.0
func ValidateMinInclusive ¶ added in v0.8.0
func ValidateMinLength ¶ added in v0.8.0
func ValidatePattern ¶ added in v0.8.0
func ValidateTotalDigits ¶ added in v0.8.0
Types ¶
type ErrorCode ¶ added in v0.7.0
type ErrorCode struct { Code string Description string Level ErrorLevel }
type ErrorLevel ¶ added in v0.7.0
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 ¶ added in v0.7.0
func (e ErrorLevel) Error() string
type ISODate ¶ added in v0.7.0
func UnmarshalISODate ¶ added in v0.7.0
func (ISODate) MarshalText ¶ added in v0.7.0
func (*ISODate) UnmarshalText ¶ added in v0.7.0
type ISODateTime ¶ added in v0.7.0
func UnmarshalISODateTime ¶ added in v0.7.0
func UnmarshalISODateTime(text string) ISODateTime
func (ISODateTime) MarshalText ¶ added in v0.7.0
func (t ISODateTime) MarshalText() ([]byte, error)
func (*ISODateTime) UnmarshalText ¶ added in v0.7.0
func (t *ISODateTime) UnmarshalText(text []byte) error
func (ISODateTime) Validate ¶ added in v0.8.0
func (t ISODateTime) Validate() error
type SerialGenerator ¶ added in v0.11.0
func PaddedSerial ¶ added in v0.11.0
func PaddedSerial(input string) SerialGenerator
PaddedSerial will format a serial number to the intended length