db

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoDatabaseCliOptions = libcli.CommonCliOptions(libcli.Mongo)

MongoDatabaseCliOptions ...

View Source
var PostgresDatabaseCliOptions = libcli.CommonCliOptions(libcli.Postgres)

PostgresDatabaseCliOptions ...

Functions

This section is empty.

Types

type LiveTrainData

type LiveTrainData struct {
	Id                        int64
	Train_id                  int64
	Location_id               int64
	Actual_time               time.Time
	Status                    int64
	First_train_number        int64
	Train_number_reference    int64
	Arrival_time_reference    time.Time
	Planned_arrival_deviation int64
	Transfer_location_id      int64
	Reporting_im_id           int64
	Next_im_id                int64
	Message_status            int64
	Message_creation          time.Time
}

func (LiveTrainData) AsProtoMessage

func (ltd LiveTrainData) AsProtoMessage() proto.Message

func (LiveTrainData) GetAll

func (ltd LiveTrainData) GetAll(rows *sql.Rows, db *gorm.DB) (time.Time, proto.Message, error)

func (LiveTrainData) GetInstance

func (ltd LiveTrainData) GetInstance() interface{}

func (LiveTrainData) TableName

func (LiveTrainData) TableName() string

type MongoDB

type MongoDB struct {
	DB *mongo.Database
}

MongoDB ...

func MongoDatabase

func MongoDatabase(config *MongoDBConfig) (*MongoDB, error)

MongoDatabase ...

type MongoDBConfig

type MongoDBConfig struct {
	Host     string
	Port     uint
	User     string
	Database string
	Password string
}

MongoDBConfig ...

func (MongoDBConfig) ParseCli

func (config MongoDBConfig) ParseCli(ctx *cli.Context) MongoDBConfig

ParseCli ...

type PlannedTrainData

type PlannedTrainData struct {
	Id                        int64
	Train_id                  int64
	Location_id               int64
	Actual_time               time.Time
	Status                    int64
	First_train_number        int64
	Train_number_reference    int64
	Arrival_time_reference    time.Time
	Planned_arrival_deviation int64
	Transfer_location_id      int64
	Reporting_im_id           int64
	Next_im_id                int64
	Message_status            int64
	Message_creation          time.Time
}

func (PlannedTrainData) TableName

func (PlannedTrainData) TableName() string

type PostgresDB

type PostgresDB struct {
	DB *gorm.DB
}

PostgresDB ...

func PostgresDatabase

func PostgresDatabase(config *PostgresDBConfig) (*PostgresDB, error)

PostgresDatabase ...

type PostgresDBConfig

type PostgresDBConfig struct {
	Host     string
	Port     uint
	User     string
	Name     string
	Password string
	SSLMode  string
}

PostgresDBConfig ...

func (PostgresDBConfig) ParseCli

func (config PostgresDBConfig) ParseCli(ctx *cli.Context) PostgresDBConfig

ParseCli ...

type WeatherData

type WeatherData struct {
	Class                string
	Latitude             float64
	Longitude            float64
	Starttimestamp       time.Time
	Endtimestamp         time.Time
	Detectiontimestamp   time.Time
	Title                string
	Description          string
	Temperature          float64
	Rain                 float64
	Windspeed            float64
	Cloudpercentage      float64
	Cityname             string
	Identifier           string
	Pressure             float64
	Ozone                float64
	Humidity             float64
	Windbearing          int64
	Precipprobability    float64
	Preciptype           string
	Dewpoint             float64
	Neareststormbearing  int64
	Neareststormdistance int64
	Visibility           float64
}

func (WeatherData) AsProtoMessage

func (wd WeatherData) AsProtoMessage() proto.Message

func (WeatherData) GetAll

func (wd WeatherData) GetAll(rows *sql.Rows, db *gorm.DB) (time.Time, proto.Message, error)

func (WeatherData) GetInstance

func (wd WeatherData) GetInstance() interface{}

func (WeatherData) TableName

func (wd WeatherData) TableName() string

Jump to

Keyboard shortcuts

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