system

package
v0.1.4-dev06032025 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Overview

Foliage primary statefun system package. Provides shared system functions for statefun packages

Index

Constants

This section is empty.

Variables

View Source
var (
	PrometricDifferentTypeExistsForIdError error = errors.New("metrics with a different type exists for an id")
	PrometricInstanceIsNil                 error = errors.New("prometrics instance the method is being call against to is nil")
)

Functions

func Base64ToStr added in v0.1.6

func Base64ToStr(base64Encoded string) string

func BoolToBytes added in v0.1.6

func BoolToBytes(b bool) []byte

func BytesToBool added in v0.1.6

func BytesToBool(data []byte) bool

func BytesToFloat64 added in v0.1.6

func BytesToFloat64(b []byte) float64

func BytesToInt64

func BytesToInt64(v []byte) int64

func CreateDimSizeChannel

func CreateDimSizeChannel[T interface{}](maxBufferElements int, onBufferOverflow func()) (in chan T, out chan T)

func Float64ToBytes added in v0.1.6

func Float64ToBytes(f float64) []byte

func GetCurrentTimeNs

func GetCurrentTimeNs() int64

func GetEnv

func GetEnv[T interface{}](key string, defaultVal T) (value T, err error)

func GetEnvMustProceed

func GetEnvMustProceed[T interface{}](key string, defaultVal T) T

func GetHashStr

func GetHashStr(str string) string

func GetUniqueStrID

func GetUniqueStrID() string

func Int64ToBytes

func Int64ToBytes(v int64) []byte

func IntToStr added in v0.1.6

func IntToStr(i int64) string

func MapsIntersection added in v0.1.3

func MapsIntersection[T interface{}](m1 map[string]T, m2 map[string]T, valuesFromMap1 bool) map[string]T

func MapsUnion added in v0.1.3

func MapsUnion[T interface{}](m1 map[string]T, m2 map[string]T) map[string]T

func MsgOnErrorReturn

func MsgOnErrorReturn(retVars ...interface{})

func SortJSONs added in v0.1.6

func SortJSONs(jsonArray []*easyjson.JSON, fields []string) []*easyjson.JSON

func SortUUIDs added in v0.1.6

func SortUUIDs(uuids []string, ascending bool) []string

func Str2Bool added in v0.1.6

func Str2Bool(boolStr string) bool

func Str2Int

func Str2Int(s string) int64

func StrToBase64 added in v0.1.6

func StrToBase64(xmlText string) string

func StringToFloat added in v0.1.6

func StringToFloat(s string) float64

Types

type KeyMutex added in v0.1.3

type KeyMutex struct {
	// contains filtered or unexported fields
}

func NewKeyMutex added in v0.1.3

func NewKeyMutex() KeyMutex

func (KeyMutex) Lock added in v0.1.3

func (s KeyMutex) Lock(key interface{})

func (KeyMutex) Unlock added in v0.1.3

func (s KeyMutex) Unlock(key interface{})

type Prometrics added in v0.1.3

type Prometrics struct {
	// contains filtered or unexported fields
}
var (
	GlobalPrometrics *Prometrics
)

func NewPrometrics added in v0.1.3

func NewPrometrics(pattern string, addr string) *Prometrics

func (*Prometrics) EnsureGaugeVec added in v0.1.3

func (pm *Prometrics) EnsureGaugeVec(id string, metric *prometheus.GaugeVec) (*prometheus.GaugeVec, error)

func (*Prometrics) EnsureGaugeVecSimple added in v0.1.3

func (pm *Prometrics) EnsureGaugeVecSimple(id string, help string, labelNames []string) (*prometheus.GaugeVec, error)

GaugeVec ---------------------------------------------------------------------------------------

func (*Prometrics) EnsureHistogramVec added in v0.1.3

func (pm *Prometrics) EnsureHistogramVec(id string, metric *prometheus.HistogramVec) (*prometheus.HistogramVec, error)

func (*Prometrics) EnsureHistogramVecSimple added in v0.1.3

func (pm *Prometrics) EnsureHistogramVecSimple(id string, help string, buckets []float64, labelNames []string) (*prometheus.HistogramVec, error)

HistogramVec -----------------------------------------------------------------------------------

func (*Prometrics) Exists added in v0.1.3

func (pm *Prometrics) Exists(id string) bool

func (*Prometrics) GetRoutinesCounter added in v0.1.3

func (pm *Prometrics) GetRoutinesCounter() *RoutinesCounter

type RoutinesCounter added in v0.1.3

type RoutinesCounter struct {
	// contains filtered or unexported fields
}

func (*RoutinesCounter) Read added in v0.1.3

func (rc *RoutinesCounter) Read(f func(key string, value int64) bool)

func (*RoutinesCounter) Started added in v0.1.3

func (rc *RoutinesCounter) Started(routineTypeName string)

func (*RoutinesCounter) Stopped added in v0.1.3

func (rc *RoutinesCounter) Stopped(routineTypeName string)

type RoutinesCounterValue added in v0.1.3

type RoutinesCounterValue struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL