homegrp

package
v0.0.0-...-c64bf0e Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package homegrp maintains the group of handlers for home access.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidID = errors.New("ID is not in its proper form")
)

Set of error variables for handling home group errors.

Functions

func Routes

func Routes(app *web.App, cfg Config)

Routes adds specific routes for this group.

Types

type AppAddress

type AppAddress 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"`
}

AppAddress represents information about an individual address.

type AppHome

type AppHome struct {
	ID          string     `json:"id"`
	UserID      string     `json:"userID"`
	Type        string     `json:"type"`
	Address     AppAddress `json:"address"`
	DateCreated string     `json:"dateCreated"`
	DateUpdated string     `json:"dateUpdated"`
}

AppHome represents information about an individual home.

type AppNewAddress

type AppNewAddress 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"`
}

AppNewAddress defines the data needed to add a new address.

type AppNewHome

type AppNewHome struct {
	Type    string        `json:"type" validate:"required"`
	Address AppNewAddress `json:"address"`
}

AppNewHome defines the data needed to add a new home.

func (AppNewHome) Validate

func (app AppNewHome) Validate() error

Validate checks if the data in the model is considered clean.

type AppUpdateAddress

type AppUpdateAddress 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"`
}

AppUpdateAddress defines the data needed to update an address.

func (AppUpdateAddress) Validate

func (app AppUpdateAddress) Validate() error

Validate checks the data in the model is considered clean.

type AppUpdateHome

type AppUpdateHome struct {
	Type    *string           `json:"type"`
	Address *AppUpdateAddress `json:"address"`
}

AppUpdateHome defines the data needed to update a home.

func (AppUpdateHome) Validate

func (app AppUpdateHome) Validate() error

Validate checks the data in the model is considered clean.

type Config

type Config struct {
	Log      *logger.Logger
	Delegate *delegate.Delegate
	Auth     *auth.Auth
	DB       *sqlx.DB
}

Config contains all the mandatory systems required by handlers.

Jump to

Keyboard shortcuts

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