region

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch

Functions

func Query

Types

type Country

type Country struct {
	ISO2        string `json:"iso2"`
	ISO3        string `json:"iso3"`
	NumCode     int    `json:"numCode"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	RegionId    string `json:"regionId"`
}

type Region

type Region struct {
	mixin.Model[Region]

	// Name of region
	Name string `json:"name"`

	// ISO 4217 currency code
	CurrencyCode string `json:"currencyCode"`

	// Whether automatic taxes are enabled
	AutomaticTaxes bool `json:"automaticTaxes"`

	// Whether tax-inclusive pricing is enabled
	TaxInclusiveEnabled bool `json:"taxInclusiveEnabled"`

	// Countries in this region (serialized to datastore)
	Countries  []Country `json:"countries" datastore:"-" orm:"default:[]"`
	Countries_ string    `json:"-" datastore:",noindex"`

	// Arbitrary metadata
	Metadata  Map    `json:"metadata,omitempty" datastore:"-" orm:"default:{}"`
	Metadata_ string `json:"-" datastore:",noindex"`
}

func New

func New(db *datastore.Datastore) *Region

func (*Region) Load

func (r *Region) Load(ps []datastore.Property) (err error)

func (*Region) Save

func (r *Region) Save() ([]datastore.Property, error)

Jump to

Keyboard shortcuts

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