util

package
v0.1.101 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomString

func RandomString(length int) string

func SetProcessGroupID added in v0.0.370

func SetProcessGroupID(cmd *exec.Cmd)

https://github.com/go-cmd/cmd/blob/master/cmd_linux.go

func TerminateProcess added in v0.0.370

func TerminateProcess(pid int) error

https://github.com/go-cmd/cmd/blob/master/cmd_linux.go

Types

type CleanupFunc

type CleanupFunc func() error

type KeyLock

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

func NewKeyLock

func NewKeyLock() *KeyLock

func (*KeyLock) Lock

func (kl *KeyLock) Lock(key string)

func (*KeyLock) Unlock

func (kl *KeyLock) Unlock(key string)

type KeyValuePair added in v0.1.62

type KeyValuePair[T any] struct {
	Key   string
	Value T
}

type KeyValuePairs added in v0.1.62

type KeyValuePairs[T any] []KeyValuePair[T]

func (KeyValuePairs[T]) MarshalJSON added in v0.1.62

func (p KeyValuePairs[T]) MarshalJSON() ([]byte, error)

func (*KeyValuePairs[T]) UnmarshalJSON added in v0.1.62

func (p *KeyValuePairs[T]) UnmarshalJSON(data []byte) error

type ReadableError

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

func NewReadableError

func NewReadableError(err error, message string) *ReadableError

func (*ReadableError) Error

func (e *ReadableError) Error() string

func (*ReadableError) Unwrap

func (e *ReadableError) Unwrap() error

type SyncMap

type SyncMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*SyncMap[K, V]) Delete

func (m *SyncMap[K, V]) Delete(key K)

func (*SyncMap[K, V]) Load

func (m *SyncMap[K, V]) Load(key K) (value V, ok bool)

func (*SyncMap[K, V]) LoadAndDelete

func (m *SyncMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)

func (*SyncMap[K, V]) LoadOrStore

func (m *SyncMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)

func (*SyncMap[K, V]) Range

func (m *SyncMap[K, V]) Range(f func(key K, value V) bool)

func (*SyncMap[K, V]) Store

func (m *SyncMap[K, V]) Store(key K, value V)

Jump to

Keyboard shortcuts

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