service

package
v0.0.0-...-91d0e34 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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