handler

package
v0.0.0-...-e9d3dc3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RentalFetchingOp

type RentalFetchingOp interface {
	GetRentalByID(ctx context.Context, rentalID int) (*model.Rental, error)
	ListRentals(ctx context.Context, filters *storage.RentalFilters) (model.Rentals, error)
}

RentalFetchingOp is a contract to a rental fetching operation.

type RentalHandler

type RentalHandler struct {
	// contains filtered or unexported fields
}

RentalHandler holds implementation of handlers for rentals.

func NewRentalHandler

func NewRentalHandler(rentalFetchingOp RentalFetchingOp) *RentalHandler

NewRentalHandler is a construction function for RentalHandler.

func (*RentalHandler) GetRentalByID

func (rh *RentalHandler) GetRentalByID(method, path string) func(w http.ResponseWriter, r *http.Request)

GetRentalByID returns a handle that is fetching a rental by id.

func (*RentalHandler) ListRentals

func (rh *RentalHandler) ListRentals(method, path string) func(w http.ResponseWriter, r *http.Request)

ListRentals returns a handle that is listing rentals based on filters.

Jump to

Keyboard shortcuts

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