Documentation ¶
Overview ¶
Package city provides support for managing city data in the database.
Index ¶
- Variables
- type City
- type Store
- func (s Store) QueryByID(ctx context.Context, traceID string, cityID string) (City, error)
- func (s Store) QueryByName(ctx context.Context, traceID string, name string) (City, error)
- func (s Store) QueryNames(ctx context.Context, traceID string) ([]string, error)
- func (s Store) Upsert(ctx context.Context, traceID string, cty City) (City, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("city not found")
)
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City struct { ID string `json:"id,omitempty"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` }
City represents a city and its coordinates.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the set of API's for city access.
func (Store) QueryByName ¶
QueryByName returns the specified city from the database by the city name.
func (Store) QueryNames ¶
QueryNames returns the list of city names currently loaded in the database.
Click to show internal directories.
Click to hide internal directories.