region

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All added in v0.17.0

func All() map[Code]Region

All provides a map of all the codes to regions.

func Register added in v0.17.0

func Register(region Region)

Register adds a new region to the shared global list of regions.

Types

type Code

type Code string

Code defines the code used to identify a region.

const (
	ES Code = "ES" // Spain
	NL Code = "NL" // Netherlands
	GB Code = "GB" // Great Britain (not Northern Ireland)
)

Defined region codes.

func Codes added in v0.17.0

func Codes() []Code

Codes provides a list of region codes contained in the collection of registered regions.

type Region

type Region interface {
	// Taxes provides a region's tax definition
	Taxes() *tax.Region

	// Currency provides the regions default currency definition.
	Currency() *currency.Def

	// Code provides this region's official code.
	Code() Code

	// Validate determines the type of GOBL document provided and attempts
	// to check the contents for errors.
	Validate(obj interface{}) error
}

Region represents the methods we expect to be available from a region.

func For added in v0.17.0

func For(code Code) Region

For returns the region definition for the document or nil if the region code is invalid or has not been registered.

Jump to

Keyboard shortcuts

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