Documentation ¶
Index ¶
- func EditMutableContextValue[V any](ctx context.Context, key MutableContextKey[V], editor EditorFunc[V])
- func ForkMutableContext(ctx context.Context) context.Context
- func MakeRandomStr(numBytes int) string
- func MustGetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V]) V
- func PanicIfErr(err error)
- func PanicIfF(cond bool, msg string, args ...interface{})
- func SetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V], value V)
- func StaticClock(sec int64) func() time.Time
- func TryGetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V]) (V, bool)
- type AbsoluteTimeSec
- type Cleaner
- type EditorFunc
- type MutableContext
- type MutableContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditMutableContextValue ¶
func EditMutableContextValue[V any](ctx context.Context, key MutableContextKey[V], editor EditorFunc[V])
func MakeRandomStr ¶
func MustGetMutableContextValue ¶
func MustGetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V]) V
func PanicIfErr ¶
func PanicIfErr(err error)
func SetMutableContextValue ¶
func SetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V], value V)
func StaticClock ¶
func TryGetMutableContextValue ¶
func TryGetMutableContextValue[V any](ctx context.Context, key MutableContextKey[V]) (V, bool)
Types ¶
type AbsoluteTimeSec ¶
type AbsoluteTimeSec int64
AbsoluteTimeSec is time in milliseconds since the Unix epoch
func FromTimeSec ¶
func FromTimeSec(tm time.Time) AbsoluteTimeSec
func (AbsoluteTimeSec) ToTime ¶
func (at AbsoluteTimeSec) ToTime() time.Time
func (AbsoluteTimeSec) ToUnix ¶
func (at AbsoluteTimeSec) ToUnix() int64
type Cleaner ¶
type Cleaner[T any] struct { // contains filtered or unexported fields }
func NewCleanup0 ¶
func NewCleanup1 ¶
type EditorFunc ¶
type MutableContext ¶
type MutableContext struct {
// contains filtered or unexported fields
}
type MutableContextKey ¶
type MutableContextKey[V any] struct { // contains filtered or unexported fields }
func NewMutableContextKey ¶
func NewMutableContextKey[V any](name string) MutableContextKey[V]
Click to show internal directories.
Click to hide internal directories.