Documentation
¶
Index ¶
- func Must[T any](obj T, err error) T
- func OptionalEnv(key string, envUsageMsg string) (string, bool)
- func RequiredEnv(key string, envUsageMsg string) string
- type LockableCancelableContext
- func (lcc *LockableCancelableContext) Cancel()
- func (lcc *LockableCancelableContext) Deadline() (deadline time.Time, ok bool)
- func (lcc *LockableCancelableContext) Done() <-chan struct{}
- func (lcc *LockableCancelableContext) Err() error
- func (lcc *LockableCancelableContext) Lock()
- func (lcc *LockableCancelableContext) Unlock()
- func (lcc *LockableCancelableContext) Value(key interface{}) interface{}
- type SetOnce
- type WaitMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptionalEnv ¶
OptionalEnv returns the value of the environment variable for key if it is set, non-empty and not only whitespace.
Pass the envUsageMsg to describe what the environment variable is used for. This will be used in the message that is printed if the environment variable is not returned.
func RequiredEnv ¶
RequiredEnv returns the value of the environment variable for key if it is set, non-empty and not only whitespace. It panics otherwise.
Pass the envUsageMsg to describe what the environment variable is used for. This will be used in the error message.
Types ¶
type LockableCancelableContext ¶
type LockableCancelableContext struct {
// contains filtered or unexported fields
}
func NewLockableCancelableContext ¶
func NewLockableCancelableContext(ctx context.Context) *LockableCancelableContext
func (*LockableCancelableContext) Cancel ¶
func (lcc *LockableCancelableContext) Cancel()
func (*LockableCancelableContext) Deadline ¶
func (lcc *LockableCancelableContext) Deadline() (deadline time.Time, ok bool)
func (*LockableCancelableContext) Done ¶
func (lcc *LockableCancelableContext) Done() <-chan struct{}
func (*LockableCancelableContext) Err ¶
func (lcc *LockableCancelableContext) Err() error
func (*LockableCancelableContext) Lock ¶
func (lcc *LockableCancelableContext) Lock()
func (*LockableCancelableContext) Unlock ¶
func (lcc *LockableCancelableContext) Unlock()
func (*LockableCancelableContext) Value ¶
func (lcc *LockableCancelableContext) Value(key interface{}) interface{}
type SetOnce ¶
type SetOnce[T any] struct { // contains filtered or unexported fields }
func NewSetOnce ¶
type WaitMap ¶
type WaitMap struct {
// contains filtered or unexported fields
}
WaitMap allows you to wait for functions with given keys and execute them only once.
func NewWaitMap ¶
func NewWaitMap() *WaitMap
Click to show internal directories.
Click to hide internal directories.