model

package
v0.0.0-...-a6120f5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	gorm.Model
	Name         string  `json:"name" gorm:"type:varchar(31);not null;default:'';unique_index"`
	Latitude     float64 `json:"latitude" gorm:"type:numeric(9,6);not null;default:0"`
	Longitude    float64 `json:"longitude" gorm:"type:numeric(9,6);not null;default:0"`
	Temperatures []Temperature
	Webhooks     []Webhook
}

City stores the city information.

type Forcast

type Forcast struct {
	Max    float64 `json:"max"`
	Min    float64 `json:"min"`
	Sample int     `json:"sample"`
}

Forcast stores the forcast information.

type Temperature

type Temperature struct {
	gorm.Model
	CityID uint    `json:"city_id" gorm:"type:int;not null;default:0"`
	Max    float64 `json:"max" gorm:"type:numeric(4,2);not null;default:0"`
	Min    float64 `json:"min" gorm:"type:numeric(4,2);not null;default:0"`
}

Temperature stores the temperature information for a city.

type Webhook

type Webhook struct {
	gorm.Model
	CityID      uint   `json:"city_id" gorm:"type:int;not null;default:0"`
	CallbackURL string `json:"callback_url" gorm:"type:varchar(2046);not null;default:''"`
}

Webhook stores the webhook information for a city.

Jump to

Keyboard shortcuts

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