package rethinkdb
import "github.com/theupdateframework/notary/storage/rethinkdb"
Index ¶
- func Connection(caFile, host string) (*gorethink.Session, error)
- func SetupDB(session *gorethink.Session, dbName string, tables []Table) error
- type Table
- type Timing
Functions ¶
func Connection ¶
Connection sets up a RethinkDB connection to the host (`host:port` format) using the CA .pem file provided at path `caFile`
func SetupDB ¶
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 ¶
- Version
- v0.3.0-RC4
- Published
- Apr 29, 2016
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 1 day ago –
Tools for package owners.