concurrent

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer added in v1.35.0

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

Buffer is a concurrency-safe bytes.Buffer. It implements io.Writer so it can be used anywhere a plain buffer would, e.g. as the output target for a log handler or as subprocess stderr.

func (*Buffer) Drain added in v1.35.0

func (b *Buffer) Drain() string

Drain returns the buffered content and resets the buffer atomically.

func (*Buffer) Reset added in v1.35.0

func (b *Buffer) Reset()

Reset clears the buffer.

func (*Buffer) String added in v1.35.0

func (b *Buffer) String() string

String returns the buffered content.

func (*Buffer) Write added in v1.35.0

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

Write appends p to the buffer.

type Map

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

func NewMap

func NewMap[K comparable, V any]() *Map[K, V]

func (*Map[K, V]) Delete

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

func (*Map[K, V]) Length

func (m *Map[K, V]) Length() int

func (*Map[K, V]) Load

func (m *Map[K, V]) Load(key K) (V, bool)

func (*Map[K, V]) Range

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

func (*Map[K, V]) Store

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

type Slice

type Slice[V any] struct {
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice[V any]() *Slice[V]

func (*Slice[V]) All

func (s *Slice[V]) All() []V

func (*Slice[V]) Append

func (s *Slice[V]) Append(value V)

func (*Slice[V]) Clear

func (s *Slice[V]) Clear()

func (*Slice[V]) Find

func (s *Slice[V]) Find(predicate func(V) bool) (V, int)

func (*Slice[V]) Get

func (s *Slice[V]) Get(index int) (V, bool)

func (*Slice[V]) Length

func (s *Slice[V]) Length() int

func (*Slice[V]) Range

func (s *Slice[V]) Range(f func(index int, value V) bool)

func (*Slice[V]) Set

func (s *Slice[V]) Set(index int, value V) bool

func (*Slice[V]) Update

func (s *Slice[V]) Update(index int, f func(V) V) bool

Jump to

Keyboard shortcuts

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