Documentation ¶
Index ¶
- Constants
- func OpenRedisSentinel(conf redisadapter.SentinelConfig) (*redis.Client, error)
- func ParseDriverName(v string) (rdb.DriverName, error)
- 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 RedisSentinelConfig
- type ULIDGenerator
- type ULIDManager
- type ULIDValidator
Constants ¶
View Source
const ( DriverNameUnknown rdb.DriverName = "" DriverNameMySQL rdb.DriverName = "mysql" )
Variables ¶
This section is empty.
Functions ¶
func OpenRedisSentinel ¶
func OpenRedisSentinel(conf redisadapter.SentinelConfig) (*redis.Client, error)
func ParseDriverName ¶
func ParseDriverName(v string) (rdb.DriverName, error)
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
type RedisSentinelConfig ¶
type RedisSentinelConfig struct {
// contains filtered or unexported fields
}
func LoadRedisSentinelConfig ¶
func LoadRedisSentinelConfig() (*RedisSentinelConfig, error)
func (*RedisSentinelConfig) MasterName ¶
func (c *RedisSentinelConfig) MasterName() string
func (*RedisSentinelConfig) SentinelAddrs ¶
func (c *RedisSentinelConfig) SentinelAddrs() []string
type ULIDGenerator ¶
type ULIDGenerator struct{}
func (*ULIDGenerator) Generate ¶
func (g *ULIDGenerator) Generate() (string, error)
type ULIDManager ¶
type ULIDManager struct {
// contains filtered or unexported fields
}
func NewULIDManager ¶
func NewULIDManager() *ULIDManager
func (*ULIDManager) Generate ¶
func (m *ULIDManager) Generate() (string, error)
func (*ULIDManager) Validate ¶
func (m *ULIDManager) Validate(v string) error
type ULIDValidator ¶
type ULIDValidator struct{}
func (*ULIDValidator) Validate ¶
func (g *ULIDValidator) Validate(v string) error
Click to show internal directories.
Click to hide internal directories.