Documentation ¶
Index ¶
- func BackgroundContext(ctx context.Context) context.Context
- func IsTemporary(err error) bool
- func Logger(ctx context.Context) logrus.FieldLogger
- func LoggerWithFields(ctx context.Context, fields logrus.Fields) (context.Context, logrus.FieldLogger)
- func MinDuration(f, s time.Duration) time.Duration
- func NewClampWriter(buf io.Writer, maxResponseSize uint64, overflowErr error) io.Writer
- func NewRNG(seed int64) *rand.Rand
- func NewSyslogHook(url *url.URL, prefix string) error
- func SetLogDest(to, prefix string)
- func SetLogLevel(ll string)
- func WithLogger(ctx context.Context, l logrus.FieldLogger) context.Context
- type Backoff
- type BoxTime
- type Clock
- type GhostReader
- type GhostWriter
- type Temporary
- type WaitGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackgroundContext ¶
BackgroundContext returns a context that is specifically not a child of the provided parent context wrt any cancellation or deadline of the parent, so that it contains all values only.
func IsTemporary ¶
func Logger ¶
func Logger(ctx context.Context) logrus.FieldLogger
Logger returns the structured logger.
func LoggerWithFields ¶
func LoggerWithFields(ctx context.Context, fields logrus.Fields) (context.Context, logrus.FieldLogger)
LoggerWithFields returns a child context of the provided parent that contains a logger with additional fields from the parent's logger, it returns the new child logger, as well.
func NewClampWriter ¶
func SetLogDest ¶
func SetLogDest(to, prefix string)
func SetLogLevel ¶
func SetLogLevel(ll string)
func WithLogger ¶
WithLogger stores the logger.
Types ¶
type GhostReader ¶
func NewGhostReader ¶
func NewGhostReader() GhostReader
type GhostWriter ¶
func NewGhostWriter ¶
func NewGhostWriter() GhostWriter
type WaitGroup ¶
type WaitGroup struct {
// contains filtered or unexported fields
}
func NewWaitGroup ¶
func NewWaitGroup() *WaitGroup
func (*WaitGroup) AddSession ¶
AddSession manipulates the session counter by adding the delta value. Incrementing the session counter is not possible and will set return value to false if a close was initiated.
func (*WaitGroup) CloseGroup ¶
func (r *WaitGroup) CloseGroup()
CloseGroup initiates a close and blocks until session counter becomes zero.
func (*WaitGroup) CloseGroupNB ¶
func (r *WaitGroup) CloseGroupNB() chan struct{}
CloseGroupNB is non-blocking version of CloseGroup which returns a channel that can be waited on.
func (*WaitGroup) Closer ¶
func (r *WaitGroup) Closer() chan struct{}
Closer returns a channel that is closed if WaitGroup is in closing state
func (*WaitGroup) DoneSession ¶
func (r *WaitGroup) DoneSession()
DoneSession decrements 1 from accumulated sessions and wakes up listeners when this reaches zero.