typeutils

package
v0.0.0-...-fe250c1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func BoolYNString

func BoolYNString(b bool) string

func BoolYesNoString

func BoolYesNoString(b bool) string

func DurationStringToSeconds

func DurationStringToSeconds(s string) (int, error)

Type Converters

func EmptyByteSliceNil

func EmptyByteSliceNil(b []byte) []byte

func Float32Ptr

func Float32Ptr(f float32) *float32

func IntDefault

func IntDefault(i int, defaultValue int) int

func IntPtr

func IntPtr(i int) *int

func MapNoEmptyValues

func MapNoEmptyValues(v any) error

func SecondsToDurationString

func SecondsToDurationString(seconds int, layout string) string

func SplitEmptyStringSliceEmpty

func SplitEmptyStringSliceEmpty(s string, sep string) []string

func SplitEmptyStringSliceNil

func SplitEmptyStringSliceNil(s string, sep string) []string

func StringDefault

func StringDefault(s string, defaultValue string) string

func StringPtr

func StringPtr(s string) *string

func StringSnakeCase

func StringSnakeCase(s string) string

func StructTags

func StructTags(key string, v any) []string

func TruncateString

func TruncateString(s string, length int, suffix string) string

Types

type Semaphore

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

type Semaphores

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

func NewSemaphores

func NewSemaphores() Semaphores

func (*Semaphores) Acquire

func (s *Semaphores) Acquire(name string) error

func (*Semaphores) Add

func (s *Semaphores) Add(name string, maximum int, timeout int)

func (*Semaphores) P

func (s *Semaphores) P(name string) error

func (*Semaphores) Release

func (s *Semaphores) Release(name string) error

func (*Semaphores) Signal

func (s *Semaphores) Signal(name string) error

func (*Semaphores) V

func (s *Semaphores) V(name string) error

func (*Semaphores) Wait

func (s *Semaphores) Wait(name string) error

Jump to

Keyboard shortcuts

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