Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Country ¶
type Country struct { Name string `yaml:",omitempty"` ISO3166 string `yaml:"iso3166-1,omitempty"` // ISO 3166-1 country code Complete bool `yaml:""` Comments string `yaml:",omitempty"` Regions []*Region `yaml:",omitempty"` }
Country information
func (*Country) GetOrCreateRegion ¶
GetOrCreateRegion based on the code identifier (e.g., iso3361) and value
func (*Country) GetRegion ¶
GetRegion returns a region by the code identifier (e.g., iso3361) and value
func (*Country) MarshalYAML ¶
MarshalYAML is a custom mashaller to sort and restoring comments automatically
func (*Country) RemoveSource ¶
RemoveSource removes data attributed to a source
type Region ¶
type Region struct { Codes map[string]string `yaml:",omitempty"` // ISO 3166-2 region code, EU identifier, etc Names []*RegionName `yaml:",omitempty"` }
Region hold the information about a region
func (*Region) MarshalYAML ¶
MarshalYAML is a custom mashaller to sort and restoring comments automatically
func (*Region) RemoveSource ¶
RemoveSource removes regions attributed to a source
Matching is done based on a prefix, this allows to remove all sources from a given website.
Language attributions are not removed, when the region exists in other sources ¶
When a region is attributed to multiple sources the region is retained and only the attribution to the removed source is removed.
type RegionName ¶
type RegionName struct { Name string `yaml:",omitempty"` // Normalized value Sources []*Source `yaml:",omitempty"` }
RegionName holds the languages and sources of a region name
func (*RegionName) MarshalYAML ¶
func (n *RegionName) MarshalYAML() (interface{}, error)
MarshalYAML is a custom mashaller to sort and restoring comments automatically
type Source ¶
type Source struct { Name string `yaml:",omitempty"` Languages []string `yaml:",omitempty,flow"` Value string `yaml:",omitempty"` // Value as included in the source Type string `yaml:",omitempty"` // To indicate alternative or other non primary names }
Source holds the original value and language
func (*Source) MarshalYAML ¶
MarshalYAML is a custom mashaller to sort and restoring comments automatically
Directories ¶
Path | Synopsis |
---|---|
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
cmd
|
|