Documentation ¶
Index ¶
- Variables
- func ValidateFilters(v *validator.Validator, f Filters)
- type Country
- type CountryModel
- func (c *CountryModel) GetAll(ctx context.Context, filters Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetByCapital(otelCtx context.Context, capital string) (*Country, error)
- func (c CountryModel) GetByCode(otelCtx context.Context, code string) (*Country, error)
- func (c CountryModel) GetByCodes(otelCtx context.Context, codes []string) ([]*Country, error)
- func (c CountryModel) GetByCurrency(otelCtx context.Context, currency string, filters Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetByDemonyms(otelCtx context.Context, demonyms string, filters Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetByLanguage(otelCtx context.Context, language string, filters Filters) ([]*Country, Metadata, error)
- func (c *CountryModel) GetByName(otelCtx context.Context, name string, filers Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetByRegion(otelCtx context.Context, region string, filters Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetBySubregion(otelCtx context.Context, subregion string, filters Filters) ([]*Country, Metadata, error)
- func (c CountryModel) GetByTranslation(otelCtx context.Context, translation string) (*Country, error)
- type Filters
- type Item
- type Metadata
- type Models
- type OtelWrappedError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRecordNotFound = errors.New("record not found") ErrEditConflict = errors.New("edit conflict") )
View Source
var ErrRecordNotFound = errors.New("record not found")
Functions ¶
func ValidateFilters ¶
Types ¶
type Country ¶
type Country struct { Name name `json:"name"` Tld []string `json:"tld,omitempty"` CCA2 string `json:"cca2,omitempty"` CCN3 string `json:"ccn3,omitempty"` CCA3 string `json:"cca3,omitempty"` CIOC string `json:"cioc,omitempty"` Independent bool `json:"independent,omitempty"` Status string `json:"status,omitempty"` UNMember bool `json:"unMember,omitempty"` Currencies map[string]currency `json:"currencies,omitempty"` IDD *idd `json:"idd,omitempty"` Capital []string `json:"capital,omitempty"` AltSpellings []string `json:"altSpellings,omitempty"` Region string `json:"region,omitempty"` SubRegion string `json:"subregion,omitempty"` Languages map[string]string `json:"languages,omitempty"` Translations map[string]translation `json:"translations,omitempty"` LatLng []float32 `json:"latlng,omitempty"` LandLocked bool `json:"landlocked,omitempty"` Borders []string `json:"borders,omitempty"` Area float32 `json:"area,omitempty"` Demonyms map[string]demonyms `json:"demonyms,omitempty"` Flag string `json:"flag,omitempty"` Maps map[string]string `json:"maps,omitempty"` Population int `json:"population,omitempty"` Gini map[string]float32 `json:"gini,omitempty"` Fifa string `json:"fifa,omitempty"` Car car `json:"car,omitempty"` Timezones []string `json:"timezones,omitempty"` Continents []string `json:"continents,omitempty"` Flags graphicsFormat `json:"flags,omitempty"` CoatOfArms *graphicsFormat `json:"coatOfArms,omitempty"` StartOfWeek string `json:"startOfWeek,omitempty"` CapitalInfo *capitalInfo `json:"capitalInfo,omitempty"` PostalCode *postalCode `json:"postalCode,omitempty"` }
type CountryModel ¶
func (CountryModel) GetByCapital ¶
func (CountryModel) GetByCodes ¶
func (CountryModel) GetByCurrency ¶
func (CountryModel) GetByDemonyms ¶
func (CountryModel) GetByLanguage ¶
func (CountryModel) GetByRegion ¶
func (CountryModel) GetBySubregion ¶
func (CountryModel) GetByTranslation ¶
type Models ¶
type Models struct {
Countries CountryModel
}
type OtelWrappedError ¶
type OtelWrappedError struct {
// contains filtered or unexported fields
}
func (*OtelWrappedError) Error ¶
func (ot *OtelWrappedError) Error() string
func (*OtelWrappedError) Unwrap ¶
func (ot *OtelWrappedError) Unwrap() error
func (*OtelWrappedError) WithSpanInfo ¶
func (ot *OtelWrappedError) WithSpanInfo(ctx context.Context, err error) error
Click to show internal directories.
Click to hide internal directories.