Documentation
¶
Overview ¶
Package swiftmessages implements a parser for SWIFT financial messages
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSwiftBlockInvalid = errors.New("swift block is invalid")
ErrSwiftBlockInvalid is raised when an invalid SWIFT financial message received.
View Source
var ErrUnexpectedType = errors.New("unexpected type")
ErrUnexpectedType is raised when an invalid value in a SWIFT block received.
Functions ¶
func Encode ¶
func Encode(swiftBlock ...SwiftBlockRule) (message string, err error)
Encode encodes swiftBlock into a SWIFT message or returns an error.
func MustEncode ¶
func MustEncode(swiftBlock ...SwiftBlockRule) string
MustEncode returns message if err is nil and panics otherwise.
Types ¶
type Parser ¶
type Parser struct {
*Lexer
}
Parser represents a parser.
func (*Parser) Parse ¶
func (p *Parser) Parse() (message SwiftMessage, err error)
Parse parses SWIFT message.
type SwiftBlock ¶
type SwiftBlock struct { ID string Value interface{} }
SwiftBlock represents a SWIFT block.
type SwiftBlockRule ¶
type SwiftBlockRule struct { SwiftBlock ShortMode bool }
SwiftBlockRule represents a SWIFT block settings.
type SwiftMessage ¶
type SwiftMessage struct {
Blocks []SwiftBlock
}
SwiftMessage represents a collection of SWIFT financial blocks.
Click to show internal directories.
Click to hide internal directories.