bban

package
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// BankCode represents bank code part of iban.
	BankCode EntryType = iota

	// BranchCode represents branch code part of iban.
	BranchCode

	// AccountNumber represents account number part of iban.
	AccountNumber

	// NationalCheckDigit represents national check digit part of iban.
	NationalCheckDigit

	// AccountType represents account type part of iban.
	AccountType

	// OwnerAccountType represents owner account type part of iban.
	OwnerAccountType

	// IdentificationNumber represents identification number part of iban.
	IdentificationNumber

	// Currency represents optional currency of iban.
	Currency

	// Padding represents optional padding of iban.
	Padding

	// Num allows only numeric characters.
	Num charType = iota

	// Zero allows only zero characters.
	Zero

	// AlphaUpper allows only uppercase alphabetic characters.
	AlphaUpper

	// AlphaNum allow only alphanumeric characters with any case.
	AlphaNum
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryType

type EntryType int

EntryType represents a type of bban part.

func (EntryType) String

func (e EntryType) String() string

String returns text representation of EntryType.

type Part

type Part struct {
	Length    int
	EntryType EntryType
	// contains filtered or unexported fields
}

Part represents a substring part of bban.

func NewAccountNumber

func NewAccountNumber(length int, char charType) Part

NewAccountNumber creates a new Part with AccountNumber EntryType.

func NewAccountType

func NewAccountType(length int, char charType) Part

NewAccountType creates a new Part with AccountType EntryType.

func NewBankCode

func NewBankCode(length int, char charType) Part

NewBankCode creates a new Part with BankCode EntryType.

func NewBranchCode

func NewBranchCode(length int, char charType) Part

NewBranchCode creates a new Part with BranchCode EntryType.

func NewCurrency added in v0.2.0

func NewCurrency(length int, char charType) Part

NewCurrency creates a new Part with Currency EntryType.

func NewIdentificationNumber

func NewIdentificationNumber(length int, char charType) Part

NewIdentificationNumber creates a new Part with IdentificationNumber EntryType.

func NewNationalCheckDigit

func NewNationalCheckDigit(length int, char charType) Part

NewNationalCheckDigit creates a new Part with NationalCheckDigit EntryType.

func NewOwnerAccountType

func NewOwnerAccountType(length int, char charType) Part

NewOwnerAccountType creates a new Part with OwnerAccountType EntryType.

func NewPadding added in v0.2.0

func NewPadding(length int, char charType) Part

NewPadding creates a new Part with Padding EntryType.

func NewPart

func NewPart(length int, char charType, entry EntryType) Part

NewPart creates a new Part.

func (Part) String

func (p Part) String() string

String returns a text representation of Part.

func (Part) Validate

func (p Part) Validate(value string) bool

Validate validates given value against part CharType.

type Structure

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

Structure represents a bban structure which consists of bban Parts.

func NewStructure

func NewStructure(parts ...Part) Structure

NewStructure creates a new Structure from given Parts.

func (Structure) Length

func (s Structure) Length() int

Length returns a length of bban calculated by summing lengths of each Part.

func (Structure) Parts

func (s Structure) Parts() []Part

Parts returns slice of Parts.

Jump to

Keyboard shortcuts

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