{"modulePath":"github.com/threefoldtech/zos_base","version":"v1.1.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Variables\n\n```go\nvar (\n\t// DefaultTerminateSignals default signals to handle\n\t// if not signals are provided\n\t// NOTE: we use the default st here instead of ALL signals\n\t// to avoid dying on signals like SIGCHLD and others that\n\t// are not intend to terminate the process\n\tDefaultTerminateSignals = []os.Signal{\n\t\tsyscall.SIGTERM, syscall.SIGHUP, syscall.SIGINT,\n\t\tsyscall.SIGQUIT,\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc NewRedisConn(address string) (redis.Conn, error)\n```\n\n```go\nfunc NewRedisPool(address string, size ...uint32) (*redis.Pool, error)\n```\n\n```go\nfunc OnDone(ctx context.Context, cb func(error))\n```\nOnDone registers a callback on a context when it's done The ctx.Err() is passed as is to the callback function\n\n```go\nfunc WithSignal(ctx context.Context, sig ...os.Signal) (context.Context, context.CancelFunc)\n```\nWithSignal return a context that is canceld if any of the specified signals was received\n\n## Types\n\n```go\ntype Mark interface {\n\tDone(ctx context.Context) error\n\tSignal()\n}\n```\nMark 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\n\n```go\nfunc NewMark() Mark\n```\n\n```go\ntype RedisDialParams struct {\n\tScheme  string\n\tHost    string\n\tOptions []redis.DialOption\n}\n```\n\n","path":"github.com/threefoldtech/zos_base/pkg/utils","name":"utils","synopsis":"","isRedistributable":true}
