Documentation ¶
Overview ¶
Package city provides support for managing city data in the database.
Index ¶
- Variables
- type City
- func (c City) Add(ctx context.Context, traceID string, cty Info) (Info, error)
- func (c City) QueryByID(ctx context.Context, traceID string, cityID string) (Info, error)
- func (c City) QueryByName(ctx context.Context, traceID string, name string) (Info, error)
- func (c City) QueryNames(ctx context.Context, traceID string) ([]string, error)
- type Info
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExists = errors.New("city exists") ErrNotFound = errors.New("city not found") )
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City struct {
// contains filtered or unexported fields
}
City manages the set of API's for city access.
func (City) Add ¶
Add adds a new city to the database. If the city already exists this function will fail but the found city is returned. If the city is being added, the city with the id from the database is returned.
func (City) QueryByName ¶
QueryByName returns the specified city from the database by the city name.
Click to show internal directories.
Click to hide internal directories.