models

package
v0.0.0-...-c717815 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	ID          uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4();primary_key"`
	LastUpdated time.Time `gorm:"type:timestamp with time zone"`
	Features    []JSONB   `gorm:"type:jsonb"`
	Type        string    `gorm:"type:varchar(50)"`
	Weather     JSONB     `gorm:"type:json"`
}

DB struct for auto-migration

type DataToCall

type DataToCall struct {
	ID          uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4();primary_key"`
	LastUpdated time.Time `gorm:"type:timestamp with time zone" json:"last_updated"`
	Features    []byte    `gorm:"type:jsonb" json:"features"`
	Type        string    `gorm:"type:varchar(50)" json:"type"`
	Weather     JSONB     `gorm:"type:json" json:"weather"`
}

Strcut to call data from PostgreSQL

type DataToInsert

type DataToInsert struct {
	ID          uuid.UUID
	LastUpdated time.Time
	Features    string
	Type        string
	Weather     JSONB
}

Struct to insert data into PostgreSQL

func (DataToInsert) TableName

func (DataToInsert) TableName() string

type Feature

type Feature struct {
	Geometry   string   `json:"geometry"`
	Properties Property `json:"properties"`
	Type       string   `json:"type"`
}

type Indego

type Indego struct {
	ID          uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4();primary_key"`
	LastUpdated time.Time `gorm:"type:timestamp with time zone" json:"last_updated"`
	Features    []JSONB   `gorm:"type:jsonb" json:"features"`
	Type        string    `gorm:"type:varchar(50)" json:"type"`
}

Struct to unMarshal the result from indego API

type JSONB

type JSONB map[string]interface{}

JSONB Interface for JSONB Field

func (*JSONB) Scan

func (a *JSONB) Scan(value interface{}) error

Scan Unmarshal

func (JSONB) Value

func (a JSONB) Value() (driver.Value, error)

Value Marshal

type Property

type Property struct {
	ID                     uint64       `json:"id"`
	Name                   string       `json:"name"`
	Coordinates            driver.Value `json:"coordinates"`
	TotalDocks             uint8        `json:"totalDocks"`
	DocksAvailable         uint8        `json:"docksAvailable"`
	BikesAvailable         uint8        `json:"bikesAvailable"`
	ClassicBikesAvailable  uint8        `json:"classicBikesAvailable"`
	SmartBikesAvailable    uint8        `json:"smartBikesAvailable"`
	ElectricBikesAvailable uint8        `json:"electricBikesAvailable"`
	RewardBikesAvailable   uint8        `json:"rewardBikesAvailable"`
	RewardDocksAvailable   uint8        `json:"rewardDocksAvailable"`
	KioskStatus            string       `json:"kioskStatus"`
	KioskPublicStatus      string       `json:"kioskPublicStatus"`
	KioskConnectionStatus  string       `json:"kioskConnectionStatus"`
	KioskType              uint8        `json:"kioskType"`
	AddressStreet          string       `json:"addressStreet"`
	AddressCity            string       `json:"addressCity"`
	AddressState           string       `json:"addressState"`
	AddressZipCode         string       `json:"addressZipCode"`
	Bikes                  []JSONB      `json:"bikes"`
	CloseTime              driver.Value `json:"closeTime"`
	EventEnd               driver.Value `json:"eventEnd"`
	EventStart             driver.Value `json:"eventStart"`
	IsEventBased           bool         `json:"isEventBased"`
	IsVirtual              bool         `json:"isVirtual"`
	KioskId                uint64       `json:"kioskId"`
	Notes                  driver.Value `json:"notes"`
	OpenTime               driver.Value `json:"openTime"`
	PublicText             string       `json:"publicText"`
	TimeZone               driver.Value `json:"timeZone"`
	TrikesAvailable        uint8        `json:"trikesAvailable"`
	Latitude               float32      `json:"latitude"`
	Longitude              float32      `json:"longitude"`
}

type ResponseByKiosk

type ResponseByKiosk struct {
	At      time.Time `json:"at"`
	Station Feature   `json:"station"`
	Weather JSONB     `json:"weather"`
}

type ResponseByTime

type ResponseByTime struct {
	At       time.Time `json:"at"`
	Stations []Feature `json:"stations"`
	Weather  JSONB     `json:"weather"`
}

Jump to

Keyboard shortcuts

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