swift

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength         = errors.New("swift: invalid length")
	ErrInvalidCase           = errors.New("swift: invalid case")
	ErrInvalidBankCode       = errors.New("swift: invalid bank code")
	ErrInvalidCountryCode    = errors.New("swift: invalid country code")
	ErrCountryCodeNotPresent = errors.New("swift: country code does not exist")
	ErrInvalidLocationCode   = errors.New("swift: invalid location code")
	ErrInvalidBranchCode     = errors.New("swift: invalid branch code")
)

Error codes returned by failures to validate an swift.

Functions

func Validate

func Validate(value string) error

Validate validates swift code.

Types

type Swift

type Swift struct {
	// contains filtered or unexported fields
}

Swift represents a swift/bic code.

func MustParse

func MustParse(value string) *Swift

MustParse tries to create new swift code, panics on failure.

func New

func New(value string) (*Swift, error)

New validates and creates new swift code. Deprecated: Use Parse instead.

func Parse added in v0.3.0

func Parse(value string) (*Swift, error)

Parse validates and creates new swift code.

func (*Swift) BankCode

func (s *Swift) BankCode() string

BankCode returns bank code of swift code.

func (*Swift) BranchCode

func (s *Swift) BranchCode() string

BranchCode returns branch code of swift code.

func (*Swift) CountryCode

func (s *Swift) CountryCode() string

CountryCode returns country code of swift code.

func (*Swift) LocationCode

func (s *Swift) LocationCode() string

LocationCode returns location code of swift code.

func (*Swift) Type

func (s *Swift) Type() Type

Type returns type of swift code.

type Type

type Type int

Type represents type of swift code.

const (
	// Type8 represents swift code with a length of 8 characters.
	Type8 Type = iota

	// Type11 represents swift code with a length of 11 characters.
	Type11
)

Jump to

Keyboard shortcuts

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