model

package
v0.0.0-...-7d4a18e Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortCitiesByName

func SortCitiesByName(c []*City, desc bool)

SortCitiesByName sorts function. Sort cities by name

func SortContinentsByCode

func SortContinentsByCode(c []*Continent, desc bool)

SortContinentsByCode sorts containers by code

func SortContinentsByName

func SortContinentsByName(c []*Continent, desc bool)

SortContinentsByName sorts containers by name

func SortCountriesByCode

func SortCountriesByCode(c []*Country, desc bool)

SortCountriesByCode sorts countries slicer by code

func SortCountriesByName

func SortCountriesByName(c []*Country, desc bool)

SortCountriesByName sorts countries slice by name

func SortRegionsByCode

func SortRegionsByCode(r []*Region, desc bool)

SortRegionsByCode sorts regions by code

func SortRegionsByName

func SortRegionsByName(r []*Region, desc bool)

SortRegionsByName sorts regions by name

Types

type City

type City struct {
	ID          int    `json:"id"`
	CountryID   int    `storm:"index" json:"-"`
	CountryCode string `storm:"index" json:"-"`
	RegionID    int    `json:"-"`
	RegionCode  string `json:"-"`
	IDKey       string `storm:"index" json:"-"`
	CodeKey     string `storm:"index" json:"-"`
	Name        string `json:"name"`
}

City data structure

type CityView

type CityView struct {
	ID          int    `json:"id"`
	CountryID   int    `json:"countryId"`
	CountryCode string `json:"countryCode"`
	CountryName string `json:"countryName"`
	RegionID    int    `json:"regionId"`
	RegionCode  string `json:"regionCode"`
	RegionName  string `json:"regionName"`
	Name        string `json:"name"`
}

CityView is city view data structure (full city data)

type Continent

type Continent struct {
	ID   int    `json:"id"`
	Code string `storm:"unique" json:"code"`
	Name string `storm:"unique" json:"name"`
}

Continent data structure

type Country

type Country struct {
	ID            int    `json:"id"`
	Code          string `storm:"unique" json:"code"`
	ContinentID   int    `storm:"index" json:"-"`
	ContinentCode string `storm:"index" json:"-"`
	Name          string `storm:"unique" json:"name"`
}

Country data type

type Region

type Region struct {
	ID          int    `json:"id"`
	Code        string `storm:"index" json:"code"`
	CountryID   int    `storm:"index" json:"-"`
	CountryCode string `storm:"index" json:"-"`
	Name        string `json:"name"`
}

Region data structure

Jump to

Keyboard shortcuts

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