Documentation ¶
Index ¶
- func GenerateRandomPin() string
- func GetRandomName() (string, error)
- func HashName(b []byte) string
- func ResolveAndStripSemver(v string) ([]string, error)
- func SelfCheck(limits SelfCheckLimit, log logger.AppLogger, unhealhtyStreak int)
- func SortedMapKeys[T any](input map[string]T) []string
- type Batcher
- type SelfCheckLimit
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomPin ¶
func GenerateRandomPin() string
func GetRandomName ¶
GetRandomName returns mnemonicoded random name
func ResolveAndStripSemver ¶ added in v0.8.0
Example (Major) ¶
vs, err := ResolveAndStripSemver("v1") fmt.Println(err) fmt.Println(vs)
Output: <nil> [1.0.0 1.0 1]
Example (Minor) ¶
vs, err := ResolveAndStripSemver("v1.2") fmt.Println(err) fmt.Println(vs)
Output: <nil> [1.2.0 1.2 1]
Example (Patch) ¶
vs, err := ResolveAndStripSemver("v1.2.3") fmt.Println(err) fmt.Println(vs)
Output: <nil> [1.2.3 1.2 1]
Example (Prerelease) ¶
vs, err := ResolveAndStripSemver("v1.2.3-beta.1") fmt.Println(err) fmt.Println(vs)
Output: <nil> [1.2.3-beta.1]
Example (Sample) ¶
vs, err := ResolveAndStripSemver("2.0.4") fmt.Println(err) fmt.Println(vs)
Output: <nil> [2.0.4 2.0 2]
func SelfCheck ¶
func SelfCheck(limits SelfCheckLimit, log logger.AppLogger, unhealhtyStreak int)
SelfCheck will watch the applications metrics, and crash it if it is considered to be unhealthy. This is only for use outside of kubernetes/docker
func SortedMapKeys ¶
Types ¶
type Batcher ¶
type Batcher struct { Watcher *fsnotify.Watcher Events chan []fsnotify.Event // Events are returned on this channel // contains filtered or unexported fields }
Batcher batches file watch events in a given interval.
func NewDirWatcher ¶
Watches a directory recursively Caller must call .Close
type SelfCheckLimit ¶
Click to show internal directories.
Click to hide internal directories.