Documentation
¶
Index ¶
- Variables
- func NewRedisConn(address string) (redis.Conn, error)
- func NewRedisPool(address string, size ...uint32) (*redis.Pool, error)
- func OnDone(ctx context.Context, cb func(error))
- func WithSignal(ctx context.Context, sig ...os.Signal) (context.Context, context.CancelFunc)
- type Mark
- type RedisDialParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTerminateSignals default signals to handle // if not signals are provided // NOTE: we use the default st here instead of ALL signals // to avoid dying on signals like SIGCHLD and others that // are not intend to terminate the process DefaultTerminateSignals = []os.Signal{ syscall.SIGTERM, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, } )
Functions ¶
func OnDone ¶
OnDone registers a callback on a context when it's done The ctx.Err() is passed as is to the callback function
func WithSignal ¶
WithSignal return a context that is canceld if any of the specified signals was received
Types ¶
type Mark ¶
Mark defined a placeholder where multiple routines can use to synchronize their operation. Routines calling Done will be blocked until one calls Signal. After that all calls to Done should return immediately
type RedisDialParams ¶
type RedisDialParams struct { Scheme string Host string Options []redis.DialOption }
Click to show internal directories.
Click to hide internal directories.