package rethinkdb

import "github.com/theupdateframework/notary/storage/rethinkdb"

Index

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

Source Files

bootstrap.go rethinkdb.go

Version
v0.3.0-RC3
Published
Apr 29, 2016
Platform
js/wasm
Imports
5 packages
Last checked
7 minutes ago

Tools for package owners.