Help us shape the future of Go! Take the 2026 Go Developer Survey

mimir

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 2 Imported by: 0

README

Mimir  Build Status GoDoc

What is Mimir ?

Mimir is a lightweight library that exposes some functions to validate some banking informations.

Validation

As the project just started, you can just validate an IBAN.
Stay tuned for updates !

Use

Install
$ go get -u github.com/vdlbk/mimir
Example : Validate an IBAN
package main

import (
	"fmt"
	"github.com/vdlbk/mimir"
)

func main(){
	IBAN := "FR1420041010050500013M02606"
	
	ok, _ := mimir.IsIBANValid(IBAN)
	fmt.Println(ok) // true
	
	badIBAN := "FR1420041010050500013M02606"
    	
    ok, _ = mimir.IsIBANValid(badIBAN)
    fmt.Println(ok) // false
}

Documentation

Index

Constants

View Source
const (
	// ErrIBANTooshort is the error when a IBAN is too short for the validation process
	ErrIBANTooshort = mimirError("IBAN is too short")

	// ErrIBANIncorrectLength is the error when a IBAN does not have the required length
	ErrIBANIncorrectLength = mimirError("IBAN incorrect length")

	// ErrIBANInvalidChecksum is the error when a IBAN is invalid
	ErrIBANInvalidChecksum = mimirError("IBAN invalid checksum")

	// ErrCountryCodeDoesNotExist is the error when you lookup for a country code that does not exists
	ErrCountryCodeDoesNotExist = mimirError("Country Code does not exist")
)
View Source
const (
	AE = countryCode("AE") // United Arab Emirates
	AL = countryCode("AL") // Albania
	AT = countryCode("AT") // Austria
	AZ = countryCode("AZ") // Azerbaijan
	BA = countryCode("BA") // BA – Bosnia and Herzegovina
	BE = countryCode("BE") // Belgium
	BG = countryCode("BG") // Bulgaria
	BH = countryCode("BH") // Bahrain
	BR = countryCode("BR") // Brazil
	BY = countryCode("BY") // Republic of Belarus
	CH = countryCode("CH") // Switzerland
	CR = countryCode("CR") // Costa Rica
	CY = countryCode("CY") // Cyprus
	CZ = countryCode("CZ") // Czech Republic
	DE = countryCode("DE") // Germany
	DK = countryCode("DK") // Denmark
	DO = countryCode("DO") // Dominican Republic
	EE = countryCode("EE") // Estonia
	ES = countryCode("ES") // Spain
	FI = countryCode("FI") // Finland
	FO = countryCode("FO") // Faroe Islands
	FR = countryCode("FR") // France
	GB = countryCode("GB") // United Kingdom
	GE = countryCode("GE") // Georgia
	GI = countryCode("GI") // Gibraltar
	GL = countryCode("GL") // Greenland
	GR = countryCode("GR") // Greece
	GT = countryCode("GT") // Guatemala
	HR = countryCode("HR") // Croatia
	HU = countryCode("HU") // Hungary
	IE = countryCode("IE") // Ireland
	IL = countryCode("IL") // Israel
	IQ = countryCode("IQ") // Iraq
	IS = countryCode("IS") // Iceland
	IT = countryCode("IT") // Italy
	JO = countryCode("JO") // Jordan
	KW = countryCode("KW") // Kuwait
	KZ = countryCode("KZ") // Kazakhstan
	LB = countryCode("LB") // Lebanon
	LC = countryCode("LC") // Saint Lucia
	LI = countryCode("LI") // Liechtenstein
	LT = countryCode("LT") // Lithuania
	LU = countryCode("LU") // Luxembourg
	LV = countryCode("LV") // Latvia
	MC = countryCode("MC") // Monaco
	MD = countryCode("MD") // Moldova
	ME = countryCode("ME") // Montenegro
	MK = countryCode("MK") // Macedonia
	MR = countryCode("MR") // Mauritania
	MT = countryCode("MT") // Malta
	MU = countryCode("MU") // Mauritius
	NL = countryCode("NL") // Netherlands
	NO = countryCode("NO") // Norway
	PK = countryCode("PK") // Pakistan
	PL = countryCode("PL") // Poland
	PS = countryCode("PS") // Palestine
	PT = countryCode("PT") // Portugal
	QA = countryCode("QA") // Qatar
	RO = countryCode("RO") // Romania
	RS = countryCode("RS") // Serbia
	SA = countryCode("SA") // Saudi Arabia
	SC = countryCode("SC") // Seychelles
	SE = countryCode("SE") // Sweden
	SI = countryCode("SI") // Slovenia
	SK = countryCode("SK") // Slovakia
	SM = countryCode("SM") // San Marino
	ST = countryCode("ST") // Sao Tome and Principe
	SV = countryCode("SV") // El Salvador
	TL = countryCode("TL") // Timor-Leste
	TN = countryCode("TN") // Tunisia
	TR = countryCode("TR") // Turkey
	UA = countryCode("UA") // Ukraine
	VA = countryCode("VA") // Vatican City State
	VG = countryCode("VG") // Virgin Islands
	XK = countryCode("XK") // Kosovo

	GF = countryCode("GF") // French Guiana
	GP = countryCode("GP") // Guadaloupe
	MQ = countryCode("MQ") // Martinique
	RE = countryCode("RE") // Reunion
	PF = countryCode("PF") // French Polynesia
	TF = countryCode("TF") // French Southern Territories
	YT = countryCode("YT") // Mayotte
	NC = countryCode("NC") // New Caledonia
	BL = countryCode("BL") // Saint Barthélemy
	MF = countryCode("MF") // Collectivity of Saint Martin
	PM = countryCode("PM") // Saint Pierre and Miquelon
	WF = countryCode("WF") // Wallis and Futuna Islands
	IM = countryCode("IM") // Isle of Man
	JE = countryCode("JE") // Jersey
	GG = countryCode("GG") // Guernsey
	AX = countryCode("AX") // Åland Islands
)

Variables

This section is empty.

Functions

func IsBBANValid

func IsBBANValid(iban string) (bool, error)

IsBBANValid checks if the given BBAN is valid based on the country its belong to

func IsIBANValid

func IsIBANValid(iban string) (bool, error)

IsIBANValid checks if the given IBAN is valid based on the country its belong to

Types

This section is empty.

Jump to

Keyboard shortcuts

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