Documentation ¶
Index ¶
- Constants
- Variables
- func AreAllChannelsClosed() bool
- func CaseInsensitiveContains(s []string, t string) bool
- func CloseAllChannels()
- func CloseChannel(ch interface{})
- func ConvertStringMapToStringPtrMap(m map[string]string) map[string]*string
- func ConvertStringPtrMapToStringMap(m map[string]*string) map[string]string
- func CreateAndRegisterChannel(channelType reflect.Type, name string, capacity int) interface{}
- func CreateShortID() string
- func DebugOpenChannels()
- func DeleteKeyFromConfig(key string) error
- func Difference(a, b []string) []string
- func DumpGoroutines()
- func EnsureAzureTags(tags map[string]string, projectID, uniqueID string) map[string]string
- func EnsureGCPLabels(labels map[string]string, projectID, uniqueID string) map[string]string
- func ExpandPath(path string) (string, error)
- func FormatDuration(d time.Duration, format int) string
- func GenerateUniqueID() string
- func GenerateUniqueName(projectID, uniqueID string) string
- func GetSafeDiskSize(i int) int32
- func InitConfig(configFile string) (string, error)
- func InterfaceSliceToStringSlice(slice []interface{}) []string
- func IsChannelClosed(chName string) bool
- func IsValidGUID(guid string) bool
- func ParseStringToIntOrZero(row string) int
- func RegisterChannel(ch interface{})
- func RemoveDuplicates(s []string) []string
- func SafeConvertToInt32(value int) int32
- func SafeDeref(s *string) string
- func StringPtr(s string) *string
- func StripAndParseJSON(input string) ([]map[string]interface{}, error)
- func StructToMap(obj interface{}) (map[string]interface{}, error)
- func ToPtr[T any](v T) *T
- func TruncateString(s string, maxLength int) string
- type CircularBuffer
- type Config
- type SafeChannel
Constants ¶
View Source
const ( FormatHours = 1 << iota FormatMinutes FormatSeconds FormatMilliseconds )
View Source
const (
ConfigFilePermissions = 0600
)
Variables ¶
View Source
var GlobalChannels []interface { Close() IsClosed() bool SetClosed() GetName() string GetChannel() interface{} }
View Source
var GlobalChannelsMutex sync.Mutex
Functions ¶
func AreAllChannelsClosed ¶
func AreAllChannelsClosed() bool
func CaseInsensitiveContains ¶
func CloseAllChannels ¶
func CloseAllChannels()
func CreateAndRegisterChannel ¶
CreateAndRegisterChannel creates a new channel of the specified type and capacity, and registers it
func DebugOpenChannels ¶
func DebugOpenChannels()
func DeleteKeyFromConfig ¶
func Difference ¶
Difference returns the elements in `a` that aren't in `b`.
func DumpGoroutines ¶
func DumpGoroutines()
func EnsureAzureTags ¶
func EnsureGCPLabels ¶
func ExpandPath ¶
func GenerateUniqueID ¶
func GenerateUniqueID() string
GenerateUniqueID generates a unique ID of length 8
func GenerateUniqueName ¶
func GetSafeDiskSize ¶
func InitConfig ¶
func InterfaceSliceToStringSlice ¶
func InterfaceSliceToStringSlice(slice []interface{}) []string
interfaceSliceToStringSlice converts a slice of interfaces to a slice of strings
func IsChannelClosed ¶
func IsValidGUID ¶
func ParseStringToIntOrZero ¶
func RegisterChannel ¶
func RegisterChannel(ch interface{})
func RemoveDuplicates ¶
func SafeConvertToInt32 ¶
func SafeDeref ¶
safeDeref safely dereferences a string pointer. If the pointer is nil, it returns a placeholder.
func StripAndParseJSON ¶
func StructToMap ¶
func TruncateString ¶
Types ¶
type CircularBuffer ¶
type CircularBuffer[T any] struct { // contains filtered or unexported fields }
func NewCircularBuffer ¶
func NewCircularBuffer[T any](size int) *CircularBuffer[T]
func (*CircularBuffer[T]) Add ¶
func (cb *CircularBuffer[T]) Add(line T)
func (*CircularBuffer[T]) GetLines ¶
func (cb *CircularBuffer[T]) GetLines() []T
type SafeChannel ¶
func NewSafeChannel ¶
func NewSafeChannel(ch interface{}, name string) *SafeChannel
func (*SafeChannel) Close ¶
func (sc *SafeChannel) Close()
func (*SafeChannel) GetChannel ¶
func (sc *SafeChannel) GetChannel() interface{}
func (*SafeChannel) GetName ¶
func (sc *SafeChannel) GetName() string
func (*SafeChannel) IsClosed ¶
func (sc *SafeChannel) IsClosed() bool
func (*SafeChannel) SetClosed ¶
func (sc *SafeChannel) SetClosed()
Click to show internal directories.
Click to hide internal directories.