utils

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LineToSlice added in v0.8.1

func LineToSlice(s string) []string

LineToSlice converts POSIX line breaks to a string slice

func MergeMap

func MergeMap(data map[string]string, resultTo interface{}) error

MergeMap copy keys from a `data` map to a `resultTo` tagged object

func SendToSocket

func SendToSocket(socket string, command string) error

SendToSocket send strings to a unix socket specified

func SizeSuffixToInt64

func SizeSuffixToInt64(size string) (int64, error)

SizeSuffixToInt64 converts a size in string format with suffix into int64

func Split added in v0.8.1

func Split(s, sep string) []string

Split returns a slice of substrings from s, separated by sep. If s is empty, Split returns an empty slice. Split will also TrimSpace() all resulting substrings.

func SplitHeaderNameValue added in v0.15.0

func SplitHeaderNameValue(header string) (name, value string, err error)

SplitHeaderNameValue splits a header line declaration into header name and value. Note that name and value might be empty for an empty input.

Types

type Queue added in v0.9.1

type Queue interface {
	QueueFacade
	Clear()
	Notify()
	Run()
	RunWithContext(context.Context)
	Len() int
	ShuttingDown() bool
	ShutDown()
}

Queue ...

func NewFailureRateLimitingQueue added in v0.9.1

func NewFailureRateLimitingQueue(failInitialWait, failMaxWait time.Duration, syncfn func(item interface{}) error) Queue

NewFailureRateLimitingQueue ...

func NewQueue added in v0.9.1

func NewQueue(sync func(item interface{})) Queue

NewQueue ...

func NewRateLimitingQueue added in v0.9.1

func NewRateLimitingQueue(rate float32, syncfn func(item interface{})) Queue

NewRateLimitingQueue ...

type QueueFacade added in v0.15.0

type QueueFacade interface {
	Add(item interface{})
	AddAfter(item interface{}, duration time.Duration)
	Remove(item interface{})
	Start(context.Context) error
}

QueueFacade ...

type Tick added in v0.8.1

type Tick struct {
	Event    string
	When     time.Time
	Duration time.Duration
}

Tick ...

type Timer added in v0.8.1

type Timer struct {
	Start time.Time
	Ticks []*Tick
	// contains filtered or unexported fields
}

Timer ...

func NewTimer added in v0.8.1

func NewTimer(observer func(task string, duration time.Duration)) *Timer

NewTimer ...

func (*Timer) AsString added in v0.8.1

func (t *Timer) AsString(totalLabel string) string

AsString ...

func (*Timer) AsValues added in v0.15.0

func (t *Timer) AsValues(totalLabel string) []interface{}

AsValues ...

func (*Timer) Tick added in v0.8.1

func (t *Timer) Tick(eventLabel string)

Tick ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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