common

package
v0.0.0-...-31b8f12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(list []string, value string) bool

func ContainsIgnoreCase

func ContainsIgnoreCase(list []string, value string) bool

func EqualsIgnoreCase

func EqualsIgnoreCase(text1 string, text2 string) bool

func Filter

func Filter(vs []string, f func(string) bool) []string

func FilterNonEmpty

func FilterNonEmpty(vs []string) []string

func FormatLocaleId

func FormatLocaleId(value string) string

func FormatUnderscore

func FormatUnderscore(value string) string

func MoveFile

func MoveFile(sourcePath, destPath string) error

This method is executed for linux OS Reference for this method: https://gist.github.com/var23rav/23ae5d0d4d830aff886c3c970b8f6c6b

func ReadFile

func ReadFile(path string) []byte

func ReadUrl

func ReadUrl(url string) []byte

func RemapCurrencyCodeToSupported

func RemapCurrencyCodeToSupported(code string) string

func UnsupportedCountryCodes

func UnsupportedCountryCodes() []string

func WriteJson

func WriteJson(target string, data interface{})

Types

type Carrier

type Carrier struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	TrackingUrl string `json:"tracking_url"`
}

func Carriers

func Carriers() []Carrier

type CarrierService

type CarrierService struct {
	Id      string  `json:"id"`
	Name    string  `json:"name"`
	Carrier Carrier `json:"carrier"`
}

func CarrierServices

func CarrierServices() []CarrierService

type Continent

type Continent struct {
	Name      string   `json:"name"`
	Code      string   `json:"code"`
	Countries []string `json:"countries"`
}

func Continents

func Continents() []Continent

type Country

type Country struct {
	Name                 string   `json:"name"`
	Iso_3166_2           string   `json:"iso_3166_2"`
	Iso_3166_3           string   `json:"iso_3166_3"`
	MeasurementSystem    string   `json:"measurement_system"`
	DefaultCurrency      string   `json:"default_currency,omitempty"`
	DefaultLanguage      string   `json:"default_language,omitempty"`
	Languages            []string `json:"languages"`
	Timezones            []string `json:"timezones"`
	DefaultDeliveredDuty string   `json:"default_delivered_duty,omitempty"`
}

func Countries

func Countries() []Country

type Currency

type Currency struct {
	Name           string           `json:"name"`
	Iso_4217_3     string           `json:"iso_4217_3"`
	NumberDecimals int              `json:"number_decimals"`
	Symbols        *CurrencySymbols `json:"symbols,omitempty"`
	DefaultLocale  string           `json:"default_locale,omitempty"`
}

func Currencies

func Currencies() []Currency

type CurrencySymbols

type CurrencySymbols struct {
	Primary string `json:"primary"`
	Narrow  string `json:"narrow,omitempty"`
}

type Language

type Language struct {
	Name      string   `json:"name"`
	Iso_639_2 string   `json:"iso_639_2"`
	Countries []string `json:"countries"`
	Locales   []string `json:"locales"`
}

func Languages

func Languages() []Language

type Locale

type Locale struct {
	Id       string        `json:"id"`
	Name     string        `json:"name"`
	Country  string        `json:"country"`
	Language string        `json:"language,omitempty"`
	Numbers  LocaleNumbers `json:"numbers"`
}

func Locales

func Locales() []Locale

type LocaleNumbers

type LocaleNumbers struct {
	Decimal string `json:"decimal"`
	Group   string `json:"group"`
}

type LocalizedTranslation

type LocalizedTranslation struct {
	Locale Locale `json:"locale"`
	Name   string `json:"name"`
}

type PaymentMethod

type PaymentMethod struct {
	Id           string              `json:"id"`
	Type         string              `json:"type"`
	Name         string              `json:"name"`
	Images       PaymentMethodImages `json:"images"`
	Regions      []string            `json:"regions"`
	Capabilities []string            `json:"capabilities"`
}

func PaymentMethods

func PaymentMethods() []PaymentMethod

type PaymentMethodImage

type PaymentMethodImage struct {
	Url    string `json:"url"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type PaymentMethodImages

type PaymentMethodImages struct {
	Small  PaymentMethodImage `json:"small"`
	Medium PaymentMethodImage `json:"medium"`
	Large  PaymentMethodImage `json:"large"`
}

type Province

type Province struct {
	Id           string                 `json:"id"`
	Iso_3166_2   string                 `json:"iso_3166_2"`
	Name         string                 `json:"name"`
	Country      string                 `json:"country"`
	ProvinceType string                 `json:"province_type"`
	Translations []LocalizedTranslation `json:"translations,omitempty"`
}

func Provinces

func Provinces() []Province

type Region

type Region struct {
	Id                 string   `json:"id"`
	Name               string   `json:"name"`
	Countries          []string `json:"countries"`
	Currencies         []string `json:"currencies"`
	Languages          []string `json:"languages"`
	MeasurementSystems []string `json:"measurement_systems"`
	Timezones          []string `json:"timezones"`
}

func Regions

func Regions() []Region

type Timezone

type Timezone struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Offset      int    `json:"offset"`
}

func Timezones

func Timezones() []Timezone

Jump to

Keyboard shortcuts

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