Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(r *routing.RouteGroup, service Service, authHandler routing.Handler, logger log.Logger)
RegisterHandlers sets up the routing of the HTTP handlers.
Types ¶
type ClinicSearchRequest ¶
type ClinicSearchRequest struct { Name string `json:"name" required:"true"` State string `json:"state"` Opens string `json:"opens"` Closes string `json:"closes"` }
ClinicSearchRequest represents a clinic search request.
func (ClinicSearchRequest) Validate ¶
func (m ClinicSearchRequest) Validate() error
Validate validates the ClinicSearchRequest fields.
type Repository ¶
type Repository interface { // QueryDentalClinic returns the list of dental clinics with the given dental clinic parameters. QueryDentalClinics(ctx context.Context, dc entity.DentalClinic) ([]entity.DentalClinic, error) // QueryVetClinic returns the list of vet clinics with the given vet clinic parameters. QueryVetClinics(ctx context.Context, vc entity.VetClinic) ([]entity.VetClinic, error) }
Repository encapsulates the logic to access dental clinics from the JSON file.
func NewRepository ¶
func NewRepository(dcFile, vcFile string, logger log.Logger) Repository
NewRepository creates a new clinics repository
type Service ¶
type Service interface { QueryDentalClinics(ctx context.Context, input ClinicSearchRequest) ([]entity.DentalClinic, error) QueryVetClinics(ctx context.Context, input ClinicSearchRequest) ([]entity.VetClinic, error) }
Service encapsulates usecase logic for clinics.
func NewService ¶
func NewService(repo Repository, logger log.Logger) Service
NewService creates a new clinics service.
Click to show internal directories.
Click to hide internal directories.