db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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
}

LiveTrainData ...

func (LiveTrainData) AsProtoMessage

func (ltd LiveTrainData) AsProtoMessage() proto.Message

AsProtoMessage ..

func (LiveTrainData) GetAll

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

GetAll ...

func (LiveTrainData) GetInstance

func (ltd LiveTrainData) GetInstance() interface{}

GetInstance ...

func (LiveTrainData) TableName

func (LiveTrainData) TableName() string

TableName ...

type MongoDB

type MongoDB struct {
	Client *mongo.Client
	DB     *mongo.Database
}

MongoDB ...

func MongoDatabase

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

MongoDatabase ...

func (*MongoDB) Close added in v0.3.0

func (db *MongoDB) Close() error

Close ...

type MongoDBConfig

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

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
}

PlannedTrainData ...

func (PlannedTrainData) TableName

func (PlannedTrainData) TableName() string

TableName ...

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
	ConnectionTolerance libcli.ConnectionTolerance
}

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
}

WeatherData ...

func (WeatherData) AsProtoMessage

func (wd WeatherData) AsProtoMessage() proto.Message

AsProtoMessage ...

func (WeatherData) GetAll

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

GetAll ...

func (WeatherData) GetInstance

func (wd WeatherData) GetInstance() interface{}

GetInstance ...

func (WeatherData) TableName

func (wd WeatherData) TableName() string

TableName ...

Jump to

Keyboard shortcuts

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