datastore

package
v0.0.0-...-0384813 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

DB ...

Functions

func GetOption

func GetOption(name string) (string, error)

GetOption returns an option value by its name

func GetPage

func GetPage(id int64) (*models.Page, error)

GetPage ...

func GetPageByHostnameAndPath

func GetPageByHostnameAndPath(hostname, path string) (*models.Page, error)

GetPageByHostnameAndPath ...

func GetUser

func GetUser(id int64) (*models.User, error)

GetUser retrieves user from datastore by its ID

func GetUserByEmail

func GetUserByEmail(email string) (*models.User, error)

GetUserByEmail retrieves user from datastore by its email

func GetVisitorByKey

func GetVisitorByKey(key string) (*models.Visitor, error)

GetVisitorByKey ...

func Init

func Init() *sql.DB

Init creates a database connection pool

func New

func New(driver string, config string) *sql.DB

New creates a new database pool

func SavePage

func SavePage(p *models.Page) error

SavePage ...

func SavePageview

func SavePageview(pv *models.Pageview) error

SavePageview ...

func SavePageviews

func SavePageviews(pvs []*models.Pageview) error

SavePageviews ...

func SaveVisitor

func SaveVisitor(v *models.Visitor) error

SaveVisitor ...

func Seed

func Seed(n int)

Seed inserts n random pageviews in the database.

func SetOption

func SetOption(name string, value string) error

SetOption updates an option by its name

Types

This section is empty.

Jump to

Keyboard shortcuts

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