Documentation ¶
Index ¶
- func GenerateRandomPin() string
- func GetFirst[T any](opts []T) *T
- func GetRandomName() (string, error)
- func HasDryRun(r *http.Request) bool
- func HashName(b []byte) string
- func Must[T any](t T, err error) T
- 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 BinaryMeta
- type IdentiHash
- type ProjectDiffResponse
- type ProjectStats
- type SelfCheckLimit
- type Suggestion
- type Suggestions
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 BinaryMeta ¶ added in v0.8.1
type BinaryMeta struct { Hash string `json:"hash"` Size uint64 `json:"size"` SizeHumanized string `json:"size_humanized"` IdentiHash []byte `json:"identi_hash"` }
BinaryMeta is a humanized version of the raw data of an object
func NewBinaryMeta ¶ added in v0.8.1
func NewBinaryMeta(a interface{}) (*BinaryMeta, error)
func NewBinaryMetaFromBytes ¶ added in v0.8.1
func NewBinaryMetaFromBytes(b []byte) BinaryMeta
For consistency, input is expectd to be the return-type of json.Marshal(input), but works with any []byte
func (BinaryMeta) Equal ¶ added in v0.8.1
func (bm BinaryMeta) Equal(bm2 BinaryMeta) bool
type IdentiHash ¶ added in v0.8.1
func NewIdentiHash ¶ added in v0.8.1
func NewIdentiHash(hash []byte) IdentiHash
type ProjectDiffResponse ¶ added in v0.8.1
type ProjectDiffResponse struct { Diff diff.Changelog `json:"diff"` A ProjectStats `json:"a"` B ProjectStats `json:"b"` }
func NewProjectDiff ¶ added in v0.8.1
func NewProjectDiff(a, b any, input models.DiffSnapshotInput) (*ProjectDiffResponse, error)
type ProjectStats ¶ added in v0.8.1
type ProjectStats struct { BinaryMeta ProjectID string `json:"project_id"` Tag string `json:"tag"` }
type SelfCheckLimit ¶
type Suggestion ¶ added in v0.8.1
type Suggestions ¶ added in v0.8.1
type Suggestions []Suggestion
func SuggestionsFor ¶ added in v0.8.1
func SuggestionsFor(typedName string, stringSlice []string, maxDistance int, maxItems int) Suggestions
func (Suggestions) Len ¶ added in v0.8.1
func (s Suggestions) Len() int
func (Suggestions) Less ¶ added in v0.8.1
func (s Suggestions) Less(i, j int) bool
func (Suggestions) String ¶ added in v0.8.1
func (s Suggestions) String() string
func (Suggestions) Swap ¶ added in v0.8.1
func (s Suggestions) Swap(i, j int)
func (Suggestions) ToStringSlice ¶ added in v0.8.1
func (s Suggestions) ToStringSlice() []string
Click to show internal directories.
Click to hide internal directories.