rethinkdb

package
v0.3.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connection

func Connection(caFile, host string) (*gorethink.Session, error)

Connection sets up a RethinkDB connection to the host (`host:port` format) using the CA .pem file provided at path `caFile`

func SetupDB

func SetupDB(session *gorethink.Session, dbName string, tables []Table) error

SetupDB handles creating the database and creating all tables and indexes.

Types

type Table

type Table struct {
	Name       string
	PrimaryKey interface{}
	// Keys are the index names. If len(value) is 0, it is a simple index
	// on the field matching the key. Otherwise, it is a compound index
	// on the list of fields in the corrensponding slice value.
	SecondaryIndexes map[string][]string
	Config           map[string]string
}

Table holds the configuration for setting up a RethinkDB table

type Timing

type Timing struct {
	CreatedAt time.Time `gorethink:"created_at"`
	UpdatedAt time.Time `gorethink:"updated_at"`
	DeletedAt time.Time `gorethink:"deleted_at"`
}

Timing can be embedded into other gorethink models to add time tracking fields

Jump to

Keyboard shortcuts

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