utils

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package utils provides common utility functions for string manipulation, data conversion, and various helper operations used across O² Control components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureTrailingSlash

func EnsureTrailingSlash(path *string)

func ExtractTaskClassName added in v1.27.0

func ExtractTaskClassName(taskName string) (string, error)

ExtractTaskClassName extracts the task class name from the provided task name string For example, we extract "readout" from the following string: "alio2-cr1-hv-gw01.cern.ch:/opt/git/ControlWorkflows/tasks/readout@12b11ac4bb652e1835e3e94806a688c951691d5f#2sP21PjpfCQ"

func IsDirEmpty

func IsDirEmpty(path string) (bool, error)

func NewUnixTimestamp added in v0.12.90

func NewUnixTimestamp() string

func ParseExtraVars added in v0.17.0

func ParseExtraVars(extraVars string) (extraVarsMap map[string]string, err error)

func ProtoString added in v0.12.0

func ProtoString(s string) *string

helper func to package strings up nicely for protobuf

func StringSliceContains added in v0.13.90

func StringSliceContains(s []string, str string) bool

func TimeTrack added in v0.19.90

func TimeTrack(start time.Time, name string, log *logrus.Entry)

func TimeTrackFunction added in v0.23.1

func TimeTrackFunction(start time.Time, log *logrus.Entry)

func TrimJitPrefix added in v1.27.0

func TrimJitPrefix(taskClassName string) string

TrimJitPrefix removes the JIT prefix from task class names. For example, "jit-ad6f2b64b7502198430d7d7f93f15bf94c088cab-qc-pp-TPC-CalibQC_long" becomes "qc-pp-TPC-CalibQC_long". If input does not contain a JIT prefix, it is returned as it is.

func TruncateString added in v1.13.0

func TruncateString(str string, length int) string

Types

This section is empty.

Directories

Path Synopsis
Package safeacks provides thread-safe acknowledgment handling for managing communication between multiple senders and a single receiver.
Package safeacks provides thread-safe acknowledgment handling for managing communication between multiple senders and a single receiver.
Package uid provides unique identifier generation functionality.
Package uid provides unique identifier generation functionality.

Jump to

Keyboard shortcuts

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