Documentation ¶
Overview ¶
Package db for interacting with database
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionOption ¶
type ConnectionOption struct { MaxIdle int MaxLifetime time.Duration MaxOpen int ConnectTimeout time.Duration KeepAliveCheckInterval time.Duration }
ConnectionOption is db connection option.
func DefaultConnectionOption ¶
func DefaultConnectionOption() *ConnectionOption
DefaultConnectionOption returns sensible conn setting.
type Option ¶
type Option struct { Host string Port int Username string Password string DatabaseName string AppContext context.Context *ConnectionOption }
Option - database option.
func NewDatabaseOption ¶
func NewDatabaseOption(host string, port int, username, password, dbName string, conn *ConnectionOption) (*Option, error)
NewDatabaseOption - default factory method.
type Options ¶
type Options func(opt *Option)
Options is functional param for db.Option
func WithConnectionOption ¶
func WithConnectionOption(co *ConnectionOption) Options
WithConnectionOption ...
func WithHostURLAndPort ¶
WithHostURLAndPort ...
Directories ¶
Path | Synopsis |
---|---|
Package mongokit provides helper to interact with mongodb storage
|
Package mongokit provides helper to interact with mongodb storage |
Package postgres provide faktory method for postgres db.Option
|
Package postgres provide faktory method for postgres db.Option |
Package rediskit helps to interact with redis storage backend
|
Package rediskit helps to interact with redis storage backend |
Click to show internal directories.
Click to hide internal directories.