testutils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupGorm

func SetupGorm() *gorm.DB

Types

type City

type City struct {
	Model
	Name string `json:"name"`
}

type Model

type Model struct {
	ID        uint       `gorm:"primaryKey" json:"id"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

type Order

type Order struct {
	Model
	Name                  string     `json:"name"`
	EstimatedShippingDate *time.Time `json:"estimated_shipping_date"`
	AmountInCents         int64      `json:"amount_in_cents"`
	Approved              bool       `json:"approved"`
	PersonID              uint       `json:"person_id"`
	Person                Person     `json:"person"`
}

type Person

type Person struct {
	Model
	Name     string     `json:"name"`
	Email    *string    `json:"email" gorm:"type:varchar(60)"`
	Age      uint8      `json:"age"`
	Birthday *time.Time `json:"birthday"`
	Active   bool       `json:"active"`
	CityID   uint       `json:"city_id"`
	City     *City      `json:"city"`
	Orders   []Order    `json:"orders"`
}

Jump to

Keyboard shortcuts

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