standards

module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT

README

standards

Go Reference Test Code Coverage Go Report Card License MIT


About

Boringly simple parsing and validation for various notations.

Supported Standards

  • 🏦 BICs
  • 💰 IBANs with country-specific BBAN validation
  • 🏴‍☠️ ISO3166-1 Alpha2 (e.g. DE, or ES)
  • 🚑 German Health Insurance Numbers (Krankenversicherungsnummern)
  • 🧓 German Pension Insurance Numbers (Renten-/ Sozialversicherungsnummern)
  • 💲 German Tax Identification Numbers (Steuer-IDs)
  • ✉ German Postal Codes (Postleitzahlen)

Each Package Is the Same

Each standard is implemented in its own package, and each package provides a type for the standard, e.g. bic.BIC for BICs. That type contains all the information that can be extracted from the notation.

package bic

type BIC struct {
	BusinessPartyPrefix string
	CountryCode         string
	BusinessPartySuffix string
	BranchCode          string
}

Each type implements:

  • String() string to get the notation pretty-printed
  • Compact() string to get the notation in compact, machine-readable form
  • MarshalText() ([]byte, error) same as Compact
  • UnmarshalText([]byte) error to parse the notation

Additionally, each package provides these two functions:

  • Parse(string) (Type, error) parses the given string, and validates it
  • IsValid(string) bool simply checks whether the given string is valid in the given standard.

License

Built with ❤ by Maximilian von Lindern. Available under the MIT License.

Directories

Path Synopsis
Package bic provides parsing and validation of BIC (ISO 9362) codes.
Package bic provides parsing and validation of BIC (ISO 9362) codes.
de
Package de contains several subpackages providing validation/parsing for German specific standards/notations.
Package de contains several subpackages providing validation/parsing for German specific standards/notations.
healthinsurancenumber
Package healthinsurancenumber provides parsing and validation for German health insurance numbers.
Package healthinsurancenumber provides parsing and validation for German health insurance numbers.
pensioninsurancenumber
Package pensioninsurancenumber provides parsing and validation for German Pension Insurance Numbers (Rentenversicherungsnummer).
Package pensioninsurancenumber provides parsing and validation for German Pension Insurance Numbers (Rentenversicherungsnummer).
postalcode
Package postalcode provides parsing and validation for German postal codes (Postleitzahl).
Package postalcode provides parsing and validation for German postal codes (Postleitzahl).
taxidentificationnumber
Package taxidentificationnumber provides parsing and validation for German Tax Identification Numbers (Steuerliche Identifikationsnummer).
Package taxidentificationnumber provides parsing and validation for German Tax Identification Numbers (Steuerliche Identifikationsnummer).
Package iban provides parsing and validation for International Bank Account Numbers (IBAN).
Package iban provides parsing and validation for International Bank Account Numbers (IBAN).
internal
validate
Package validate provides validation utilities.
Package validate provides validation utilities.
tools
codegen/iso3166-1
Command iso3166-1 generates [iso3166.Alpha2Code] structs for all iso3166-1 country codes.
Command iso3166-1 generates [iso3166.Alpha2Code] structs for all iso3166-1 country codes.

Jump to

Keyboard shortcuts

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