Documentation ¶
Overview ¶
Package homeapp maintains the app layer api for the home domain.
Index ¶
- type Address
- type App
- func (a *App) Create(ctx context.Context, app NewHome) (Home, error)
- func (a *App) Delete(ctx context.Context) error
- func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[Home], error)
- func (a *App) QueryByID(ctx context.Context) (Home, error)
- func (a *App) Update(ctx context.Context, app UpdateHome) (Home, error)
- type Home
- type NewAddress
- type NewHome
- type QueryParams
- type UpdateAddress
- type UpdateHome
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Address1 string `json:"address1"` Address2 string `json:"address2"` ZipCode string `json:"zipCode"` City string `json:"city"` State string `json:"state"` Country string `json:"country"` }
Address represents information about an individual address.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App manages the set of app layer api functions for the home domain.
type Home ¶
type Home struct { ID string `json:"id"` UserID string `json:"userID"` Type string `json:"type"` Address Address `json:"address"` DateCreated string `json:"dateCreated"` DateUpdated string `json:"dateUpdated"` }
Home represents information about an individual home.
type NewAddress ¶
type NewAddress struct { Address1 string `json:"address1" validate:"required,min=1,max=70"` Address2 string `json:"address2" validate:"omitempty,max=70"` ZipCode string `json:"zipCode" validate:"required,numeric"` City string `json:"city" validate:"required"` State string `json:"state" validate:"required,min=1,max=48"` Country string `json:"country" validate:"required,iso3166_1_alpha2"` }
NewAddress defines the data needed to add a new address.
type NewHome ¶
type NewHome struct { Type string `json:"type" validate:"required"` Address NewAddress `json:"address"` }
NewHome defines the data needed to add a new home.
type QueryParams ¶
type QueryParams struct { Page string Rows string OrderBy string ID string UserID string Type string StartCreatedDate string EndCreatedDate string }
QueryParams represents the set of possible query strings.
type UpdateAddress ¶
type UpdateAddress struct { Address1 *string `json:"address1" validate:"omitempty,min=1,max=70"` Address2 *string `json:"address2" validate:"omitempty,max=70"` ZipCode *string `json:"zipCode" validate:"omitempty,numeric"` City *string `json:"city"` State *string `json:"state" validate:"omitempty,min=1,max=48"` Country *string `json:"country" validate:"omitempty,iso3166_1_alpha2"` }
UpdateAddress defines the data needed to update an address.
type UpdateHome ¶
type UpdateHome struct { Type *string `json:"type"` Address *UpdateAddress `json:"address"` }
UpdateHome defines the data needed to update a home.
func (*UpdateHome) Decode ¶
func (app *UpdateHome) Decode(data []byte) error
Decode implments the decoder interface.
func (UpdateHome) Validate ¶
func (app UpdateHome) Validate() error
Validate checks the data in the model is considered clean.
Click to show internal directories.
Click to hide internal directories.