Documentation
¶
Index ¶
- Variables
- func OpenDB(cfg Config) (*sql.DB, error)
- func OpenMySQL(user, password, database, host, port string) (*sql.DB, error)
- func OpenPostgres(user, password, database, host, port string) (*sql.DB, error)
- func OpenRedis(redisAddress, redisPassword string) *redis.Client
- func ValidateFilePath(path string) error
- type Config
- type PipelineHook
- func (p PipelineHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (p PipelineHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (p PipelineHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (p PipelineHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
var CTX = context.Background()
CTX is the global context for Redis
Functions ¶
func OpenMySQL ¶ added in v1.0.3
OpenMySQL opens a MySQL connection with a desired user, password, database name, host, and port
func OpenPostgres ¶ added in v1.0.3
OpenPostgres opens a PostgreSQL connection with a desired user, password database name, host and port
func OpenRedis ¶ added in v1.0.3
OpenRedis opens a redis connection with a desired address and password
func ValidateFilePath ¶ added in v1.0.3
ValidateFilePath validates the filepath of a given file
Types ¶
type Config ¶ added in v1.0.3
type Config struct {
SQLType string `yaml:"sqltype"`
SQLUser string `yaml:"sqluser"`
SQLPassword string `yaml:"sqlpassword"`
SQLDatabase string `yaml:"sqldatabase"`
SQLHost string `yaml:"sqlhost"`
SQLPort string `yaml:"sqlport"`
SQLTable string `yaml:"sqltable"`
RedisAddr string `yaml:"redisaddr"`
RedisPass string `yaml:"redispass"`
LogLevel *uint8 `yaml:"log_level"`
LogFilename *string `yaml:"log_filename"`
}
Config is the configuration struct for redisql
func (Config) CopyToHash ¶ added in v1.0.3
CopyToHash reads a desired SQL table's rows and writes them to Redis hashes
func (Config) CopyToList ¶ added in v1.0.3
CopyToList reads a desired SQL table's rows and writes them to Redis lists
func (Config) CopyToString ¶ added in v1.0.3
CopyToString reads a desired SQL table's rows and writes them to Redis strings
type PipelineHook ¶ added in v1.0.3
type PipelineHook struct {
}
func (PipelineHook) AfterProcess ¶ added in v1.0.3
Required to implement a hook
func (PipelineHook) AfterProcessPipeline ¶ added in v1.0.3
func (PipelineHook) BeforeProcess ¶ added in v1.0.3
Required to implement a hook