Documentation
¶
Index ¶
- type City
- type CityService
- func (s *CityService) Create(city cities.CityRequest) (string, error)
- func (s *CityService) Delete(id int) error
- func (s *CityService) GetFromDistrict(distinct string) ([]string, error)
- func (s *CityService) GetFromFoundation(start, end int) ([]string, error)
- func (s *CityService) GetFromPopulation(start, end int) ([]string, error)
- func (s *CityService) GetFromRegion(region string) ([]string, error)
- func (s *CityService) GetFull(id int) (*cities.City, error)
- func (s *CityService) SetPopulation(id, population int) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City interface { Create(city cities.CityRequest) (string, error) Delete(id int) error SetPopulation(id, population int) error GetFromRegion(region string) ([]string, error) GetFromDistrict(district string) ([]string, error) GetFromPopulation(start, end int) ([]string, error) GetFromFoundation(start, end int) ([]string, error) GetFull(id int) (*cities.City, error) }
type CityService ¶
type CityService struct {
// contains filtered or unexported fields
}
func NewCityService ¶
func NewCityService(repo repository.CityList) *CityService
func (*CityService) Create ¶
func (s *CityService) Create(city cities.CityRequest) (string, error)
Create sends information to the repository and returns a response
func (*CityService) Delete ¶
func (s *CityService) Delete(id int) error
Delete sends information to the repository and returns a response
func (*CityService) GetFromDistrict ¶
func (s *CityService) GetFromDistrict(distinct string) ([]string, error)
GetFromDistrict sends information to the repository and returns a response
func (*CityService) GetFromFoundation ¶
func (s *CityService) GetFromFoundation(start, end int) ([]string, error)
GetFromFoundation sends information to the repository and returns a response
func (*CityService) GetFromPopulation ¶
func (s *CityService) GetFromPopulation(start, end int) ([]string, error)
GetFromPopulation sends information to the repository and returns a response
func (*CityService) GetFromRegion ¶
func (s *CityService) GetFromRegion(region string) ([]string, error)
GetFromRegion sends information to the repository and returns a response
func (*CityService) GetFull ¶
func (s *CityService) GetFull(id int) (*cities.City, error)
GetFull sends information to the repository and returns a response
func (*CityService) SetPopulation ¶
func (s *CityService) SetPopulation(id, population int) error
SetPopulation sends information to the repository and returns a response
type Service ¶
type Service struct {
City
}
func NewService ¶
func NewService(repos *repository.Repository) *Service
Click to show internal directories.
Click to hide internal directories.