Documentation
¶
Overview ¶
Copyright 2022. Motty Cohen
Hash utilities ¶
Copyright 2022. Motty Cohen
JSON utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecoverAll ¶
func RecoverAll(cb func(v any))
All performs recover for all panics.
Sample usage:
defer RecoverAll(func(err any) {
fmt.Printf("got error: %s", err)
})
func RecoverAny ¶
Any performs call cb function with recovered value in case when recovered value exists in slice errors.
Sample usage:
defer recover.Any([]error{ErrorUsernameBlank, ErrorUsernameAlreadyTaken}, func(err any) {
fmt.Printf("got error: %s", err)
})
func RecoverOne ¶
One performs call cb function with recovered value in case when recovered value equals to e otherwise panic won't be recovered and will be propagated.
Sample usage:
defer recover.One(ErrorUsernameBlank, func(err any) {
fmt.Printf("got error: %s", err)
})
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
* TTLCache - an in-memory cache with expiration * TTLCache is a simple key/value cache in golang with the following functions: * * 1.
|
* TTLCache - an in-memory cache with expiration * TTLCache is a simple key/value cache in golang with the following functions: * * 1. |
Click to show internal directories.
Click to hide internal directories.