utils

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 10 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.

Types

type Queue added in v0.9.1

type Queue interface {
	Add(item interface{})
	Clear()
	Notify()
	Remove(item interface{})
	Run()
	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 Tick added in v0.8.1

type Tick struct {
	Event string
	When  time.Time
}

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) Tick added in v0.8.1

func (t *Timer) Tick(eventLabel string)

Tick ...

Jump to

Keyboard shortcuts

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