rtp

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddError added in v0.8.0

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

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

func AlphaSerialNumber(length int) string

AlphaSerialNumber will generate an alphanumeric serial number from the current timestamp

func Arr added in v0.7.0

func Arr[T any](v T) []*T

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

func Eastern() *time.Location

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 MarshalISODate(t ISODate) string

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

func NumericSerialNumber(length int) string

NumericSerialNumber will generate an numeric serial number from the current timestamp

func Ptr added in v0.7.0

func Ptr[T any](v T) *T

func RandomSerial added in v0.11.0

func RandomSerial(length int) string

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 ValidateEnumeration(value string, enumeration ...string) error

func ValidateFractionDigits added in v0.8.0

func ValidateFractionDigits(value string, maxValue int) error

func ValidateLength added in v0.8.0

func ValidateLength(value string, length int) error

func ValidateMaxExclusive added in v0.8.0

func ValidateMaxExclusive(value int, maxValue int) error

func ValidateMaxInclusive added in v0.8.0

func ValidateMaxInclusive(value int, maxValue int) error

func ValidateMaxLength added in v0.8.0

func ValidateMaxLength(value string, maxLength int) error

func ValidateMinExclusive added in v0.8.0

func ValidateMinExclusive(value int, minValue int) error

func ValidateMinInclusive added in v0.8.0

func ValidateMinInclusive(value int, minValue int) error

func ValidateMinLength added in v0.8.0

func ValidateMinLength(value string, minLength int) error

func ValidatePattern added in v0.8.0

func ValidatePattern(value string, regex string) error

func ValidateTotalDigits added in v0.8.0

func ValidateTotalDigits(value string, maxValue int) error

Types

type Amount added in v0.7.0

type Amount float64

func (Amount) MarshalText added in v0.7.0

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

func (Amount) Validate added in v0.8.0

func (a Amount) Validate() error

type Cdata added in v0.7.0

type Cdata struct {
	CDataString string `xml:",cdata"`
}

func (Cdata) Validate added in v0.8.0

func (c Cdata) Validate() error

type ErrorCode added in v0.7.0

type ErrorCode struct {
	Code        string
	Description string
	Level       ErrorLevel
}

func IsError added in v0.7.0

func IsError(code string) *ErrorCode

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

type ISODate civil.Date

func UnmarshalISODate added in v0.7.0

func UnmarshalISODate(text string) ISODate

func (ISODate) MarshalText added in v0.7.0

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

func (*ISODate) UnmarshalText added in v0.7.0

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

func (ISODate) Validate added in v0.8.0

func (t ISODate) Validate() error

type ISODateTime added in v0.7.0

type ISODateTime time.Time

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

type SerialGenerator func(length int) string

func PaddedSerial added in v0.11.0

func PaddedSerial(input string) SerialGenerator

PaddedSerial will format a serial number to the intended length

Jump to

Keyboard shortcuts

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