db

package
v0.0.0-...-c4afa3a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHome

func DeleteHome(db *pg.DB, homeID int64) error

func NewDB

func NewDB() (*pg.DB, error)

Types

type Agent

type Agent struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type Home

type Home struct {
	ID          int64  `json:"id"`
	Price       int64  `json:"price"`
	Description string `json:"description"`
	Address     string `json:"address"`
	AgentID     int64  `json:"agent_id"`
	Agent       *Agent `pg:"rel:has-one" json:"agent"`
}

func CreateHome

func CreateHome(db *pg.DB, req *Home) (*Home, error)

func GetHome

func GetHome(db *pg.DB, homeID string) (*Home, error)

func GetHomes

func GetHomes(db *pg.DB) ([]*Home, error)

func UpdateHome

func UpdateHome(db *pg.DB, req *Home) (*Home, error)

Jump to

Keyboard shortcuts

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