db

package
v0.0.0-...-c1c2a17 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package db contains functions and data for inserting vehicle position data into a SQLite database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a client for connecting to a SQLite database and inserting vehicle positions.

func NewClient

func NewClient(dbURL string) (*Client, error)

NewClient creates a new Client.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying client database connection.

func (*Client) Initialize

func (c *Client) Initialize(ctx context.Context) error

Initialize initializes the database for the client. If the necessary tables already exist, this is a no-op.

func (*Client) InsertVehiclePositions

func (c *Client) InsertVehiclePositions(ctx context.Context, t time.Time, ps map[string][]transitview.VehiclePosition) error

InsertVehiclePositions inserts the given map of routes to vehicle positions as recorded at the given time into the database.

Jump to

Keyboard shortcuts

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