Documentation
¶
Index ¶
- func AdminConnection(tlsOpts tlsconfig.Options, host string) (*gorethink.Session, error)
- func CreateAndGrantDBUser(session *gorethink.Session, dbName, username, password string) error
- func SetupDB(session *gorethink.Session, dbName string, tables []Table) error
- func UserConnection(tlsOpts tlsconfig.Options, host, username, password string) (*gorethink.Session, error)
- type Table
- type Timing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminConnection ¶ added in v0.4.0
AdminConnection sets up an admin RethinkDB connection to the host (`host:port` format) using the CA .pem file provided at path `caFile`
func CreateAndGrantDBUser ¶ added in v0.4.0
CreateAndGrantDBUser handles creating a rethink user and granting it permissions to the provided db.
func UserConnection ¶ added in v0.4.0
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.
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
//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
Click to show internal directories.
Click to hide internal directories.