notary: github.com/docker/notary/storage/rethinkdb Index | Files

package rethinkdb

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

Index

Package Files

bootstrap.go rethinkdb.go

func AdminConnection Uses

func AdminConnection(tlsOpts tlsconfig.Options, host string) (*gorethink.Session, error)

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

func CreateAndGrantDBUser Uses

func CreateAndGrantDBUser(session *gorethink.Session, dbName, username, password string) error

CreateAndGrantDBUser handles creating a rethink user and granting it permissions to the provided db.

func SetupDB Uses

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

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

func UserConnection Uses

func UserConnection(tlsOpts tlsconfig.Options, host, username, password string) (*gorethink.Session, error)

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

type Table Uses

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 corresponding slice value.
    SecondaryIndexes map[string][]string
    Config           map[string]string
    //JSONUnmarshaller takes a byte slice representing JSON data and knows how
    //to unmarshal them into a model representing this table
    JSONUnmarshaller func([]byte) (interface{}, error)
}

Table holds the configuration for setting up a RethinkDB table

type Timing Uses

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

Package rethinkdb imports 6 packages (graph) and is imported by 6 packages. Updated 2019-04-15. Refresh now. Tools for package owners.