util

package
v0.30.11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap added in v0.25.0

func CopyMap(m map[string]interface{}) map[string]interface{}

func MultiCloserAppend added in v0.25.0

func MultiCloserAppend(closers ...io.Closer) io.Closer

func MultiWriterAppend added in v0.25.0

func MultiWriterAppend(writers ...io.Writer) (multiWriter io.Writer)

func SpewJSON added in v0.25.0

func SpewJSON(v interface{}) string

func StructTagName added in v0.25.0

func StructTagName(v reflect.Value, i int, key string) string

Types

type Buffer

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

Buffer is a thread-safe bytes.Buffer

func (*Buffer) Read

func (b *Buffer) Read(p []byte) (n int, err error)

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) Write

func (b *Buffer) Write(p []byte) (n int, err error)

type MultiErrorGroup added in v0.25.0

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

MultiErrorGroup is a collection of goroutines working on subtasks that are part of the same overall task.

func MultiErrorGroupWithContext added in v0.25.0

func MultiErrorGroupWithContext(ctx context.Context) (*MultiErrorGroup, context.Context)

MultiErrorGroupWithContext returns a new Group and an associated Context derived from ctx.

The derived Context is canceled the first time a function passed to Go returns a non-nil error or the first time Wait returns, whichever occurs first.

func (*MultiErrorGroup) Go added in v0.25.0

func (g *MultiErrorGroup) Go(f func() error)

Go calls the given function in a new goroutine.

The first call to return a non-nil error cancels the group; its error will be returned by Wait.

func (*MultiErrorGroup) Wait added in v0.25.0

func (g *MultiErrorGroup) Wait() error

Wait blocks until all function calls from the Go method have returned, then returns the all non-nil errors (if any) as a MultiError.

Jump to

Keyboard shortcuts

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