Documentation ¶
Index ¶
- Constants
- type MySQLConfig
- type RDB
- type RDBTransaction
- func (rt *RDBTransaction) Commit() error
- func (rt *RDBTransaction) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (rt *RDBTransaction) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (rt *RDBTransaction) NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (rt *RDBTransaction) Rollback() error
- func (rt *RDBTransaction) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- type S3Client
- type S3Config
Constants ¶
View Source
const ( DriverNameUnknown rdb.DriverName = "" DriverNameMySQL rdb.DriverName = "mysql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLConfig ¶
type MySQLConfig struct { Host string `envconfig:"HOST" required:"true"` User string `envconfig:"USER" required:"true"` Database string `envconfig:"DATABASE" required:"true"` Password string `envconfig:"PASSWORD" required:"true"` Port int `envconfig:"PORT" default:"3306"` MaxConns int `envconfig:"MAX_CONNS" default:"1"` }
func LoadMySQLConfig ¶
func LoadMySQLConfig() (*MySQLConfig, error)
func (*MySQLConfig) GetDSN ¶
func (c *MySQLConfig) GetDSN() string
func (*MySQLConfig) GetDriverName ¶
func (c *MySQLConfig) GetDriverName() rdb.DriverName
func (*MySQLConfig) GetMaxConns ¶
func (c *MySQLConfig) GetMaxConns() int
type RDBTransaction ¶
type RDBTransaction struct {
// contains filtered or unexported fields
}
func (*RDBTransaction) Commit ¶
func (rt *RDBTransaction) Commit() error
func (*RDBTransaction) Get ¶
func (rt *RDBTransaction) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
func (*RDBTransaction) Rollback ¶
func (rt *RDBTransaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.