Documentation
¶
Index ¶
- type App
- func (a *App) Create(ctx context.Context, app NewCity) (City, error)
- func (a *App) Delete(ctx context.Context, id uuid.UUID) error
- func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[City], error)
- func (a *App) QueryByID(ctx context.Context, id uuid.UUID) (City, error)
- func (a *App) Update(ctx context.Context, app UpdateCity, id uuid.UUID) (City, error)
- type City
- type NewCity
- type QueryParams
- type UpdateCity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App manages the set of app layer api functions for the city domain.
func NewAppWithAuth ¶
NewAppWithAuth constructs a city app API for use with auth support.
type City ¶
type City struct { ID string `json:"id"` RegionID string `json:"region_id"` Name string `json:"name"` }
func ToAppCities ¶
type NewCity ¶
type NewCity struct { RegionID string `json:"regionID" validate:"required"` Name string `json:"name" validate:"required,min=3,max=100"` }
NewCity defines the data needed to add a city.
type QueryParams ¶
type QueryParams struct { Page string Rows string OrderBy string ID string RegionID string Name string }
QueryParams represents the query parameters that can be used.
type UpdateCity ¶
UpdateCity defines the data needed to update a city.
func (*UpdateCity) Decode ¶
func (app *UpdateCity) Decode(data []byte) error
Decode implements the decoder interface.
func (UpdateCity) Validate ¶
func (app UpdateCity) Validate() error
Validate checks the data in the model is considered clean.
Click to show internal directories.
Click to hide internal directories.