Documentation ¶
Index ¶
- func Address(network, host string) string
- func CallWithContext(ctx context.Context, fn func() error) error
- func CopyMatchingTag(from interface{}, to interface{}, tag string, ...)
- func EqualStrings(a, b []string) bool
- func FillNil(data interface{})
- func FillNilExceptDeprecated(data interface{})
- func FillNilSlices(data interface{}) error
- func NiceDurationString(d time.Duration) string
- func SetDefaults(data interface{})
- func UniqueTrimmedStrings(ss []string) []string
- type MultiSemaphore
- type Semaphore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallWithContext ¶ added in v1.4.1
func CopyMatchingTag ¶ added in v0.14.42
func CopyMatchingTag(from interface{}, to interface{}, tag string, shouldCopy func(value string) bool)
CopyMatchingTag copies fields tagged tag:"value" from "from" struct onto "to" struct.
func EqualStrings ¶ added in v1.17.0
func FillNilExceptDeprecated ¶ added in v1.12.1
func FillNilExceptDeprecated(data interface{})
func FillNilSlices ¶
func FillNilSlices(data interface{}) error
FillNilSlices sets default value on slices that are still nil.
func NiceDurationString ¶ added in v1.8.0
func SetDefaults ¶
func SetDefaults(data interface{})
SetDefaults sets default values on a struct, based on the default annotation.
func UniqueTrimmedStrings ¶ added in v1.2.0
UniqueTrimmedStrings returns a list of all unique strings in ss, in the order in which they first appear in ss, after trimming away leading and trailing spaces.
Types ¶
type MultiSemaphore ¶ added in v1.18.1
type MultiSemaphore []*Semaphore
MultiSemaphore combines semaphores, making sure to always take and give in the same order (reversed for give). A semaphore may be nil, in which case it is skipped.
func (MultiSemaphore) Give ¶ added in v1.18.1
func (s MultiSemaphore) Give(size int)
func (MultiSemaphore) Take ¶ added in v1.18.1
func (s MultiSemaphore) Take(size int)
func (MultiSemaphore) TakeWithContext ¶ added in v1.18.1
func (s MultiSemaphore) TakeWithContext(ctx context.Context, size int) error
type Semaphore ¶ added in v1.18.1
type Semaphore struct {
// contains filtered or unexported fields
}
func NewSemaphore ¶ added in v1.18.1
func (*Semaphore) SetCapacity ¶ added in v1.18.1
Click to show internal directories.
Click to hide internal directories.