countries

package
v6.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Generic error for country code handling
	ErrCountryGENERIC = errors.New("issue with country codes")
)

Functions

func FindCountryA2CodeStr

func FindCountryA2CodeStr(codeOrTranslation string) string

FindCountryA2CodeStr is a shortcut to quickly have an alpha 2 code from a code or translation

func SetNeededCountryCodes

func SetNeededCountryCodes(alpha2Code ...string)

SetNeededCountryCodes is used to specify the country codes (FR, GB, IT, etc) that the application can restrict to

Types

type CountryCode

type CountryCode struct {
	Alpha2Code   string
	Alpha3Code   string
	NumCode      int
	Translations map[Lang]*Translation
}

CountryCode : a country code, with its translations

func FindCountryCode

func FindCountryCode(codeOrTranslation string) *CountryCode

FindCountryCode retrieves a country code by a code or a translation

type Lang

type Lang string

Lang helps listing languages

const (
	LangDE Lang = "DE"
	LangEN Lang = "EN"
	LangES Lang = "ES"
	LangFR Lang = "FR"
	LangIT Lang = "IT"
	LangNL Lang = "NL"
)

The languages managed by vostok apps

type Translation

type Translation struct {
	Language Lang
	Short    string
	Long     string
}

Translation helps keeping a translation for a given language

Jump to

Keyboard shortcuts

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