util_context

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCheckIntervalMillis = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicTime

type AtomicTime struct {
	// contains filtered or unexported fields
}

func NewAtomicTime

func NewAtomicTime(t0 time.Time) *AtomicTime

func (*AtomicTime) Get

func (at *AtomicTime) Get() time.Time

func (*AtomicTime) Set

func (at *AtomicTime) Set(t time.Time)

type ResetFunc

type ResetFunc func()

func WithTimeoutAndReset

func WithTimeoutAndReset(
	parent context.Context,
	timeout time.Duration,
) (context.Context, context.CancelFunc, ResetFunc)

func WithTimeoutAndResetC

func WithTimeoutAndResetC(
	parent context.Context,
	timeout time.Duration,
	checkInterval time.Duration,
) (context.Context, context.CancelFunc, ResetFunc)

type ResetWriter

type ResetWriter interface {
	io.Writer
}

func NewResetWriter

func NewResetWriter(w io.Writer, resetFunc ResetFunc) ResetWriter

func NewResetWriterCh

func NewResetWriterCh(w io.Writer, resetChan chan any) ResetWriter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL