db

package
v0.0.0-...-a8ae919 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DevEnv = false

DevEnv toggles between SQL addresses for local or prod development

View Source
const InsertQuery string = "INSERT INTO intents VALUES(?, ?, ?)"

InsertQuery is a prepared SQL query of form url, intent, date

View Source
const PingTimeout time.Duration = 3 * time.Second

PingTimeout is the time to wait before cancelling database ping context

View Source
const RetryTimeout time.Duration = 10 * time.Second

RetryTimeout is the time to wait before reattempting database connection

Variables

View Source
var ErrNotConnected error = errors.New("No connection to database")

ErrNotConnected should be thrown when there is no established connection to the database

Functions

func LogIntent

func LogIntent(url, intent string) error

LogIntent inserts log entry into cloudsql db

Types

type Intent

type Intent struct {
	Url    string
	Intent string
	Time   string
}

func FetchIntents

func FetchIntents() ([]Intent, error)

FetchIntents returns a query containing all intents

Jump to

Keyboard shortcuts

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