Documentation ¶
Index ¶
- func Conn() *sqlx.DB
- func Connect(optStr string) (db *sqlx.DB, err error)
- func ConnectWithOpts(opts *ConnOpts) (db *sqlx.DB, err error)
- func NamedConn(name string) *sqlx.DB
- func NewDefaultApp(name string, appVersion teak.Version, apiVersion int, desc string) *teak.App
- func NewStorage() teak.DataStorage
- func NewUserStorage() teak.UserStorage
- func SetDefaultConn(db *sqlx.DB)
- func SetNamedConn(name string, db *sqlx.DB)
- type ConnOpts
- type DBAttr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectWithOpts ¶
ConnectWithOpts - connect to postgresdb based on given options
func NamedConn ¶
NamedConn - gives connection to database associated with given name. If no connection exists with given name nil is returned. If name is empty default connection is returned
func NewDefaultApp ¶
NewDefaultApp - creates a new app with MongoDB based storage providers
func NewStorage ¶
func NewStorage() teak.DataStorage
NewStorage - creates a new mongodb based data storage implementation
func NewUserStorage ¶
func NewUserStorage() teak.UserStorage
NewUserStorage - creates a new user storage based on postgres
func SetDefaultConn ¶
SetDefaultConn - sets the default postgres connection
func SetNamedConn ¶
SetNamedConn - register a postgres connection against name
Types ¶
type ConnOpts ¶
type ConnOpts struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` DBName string `json:"dbName"` }
ConnOpts - postgres connection options
Click to show internal directories.
Click to hide internal directories.