singleflight

package
v0.0.0-...-56972d6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group[T any] struct {
	// contains filtered or unexported fields
}

func (*Group[T]) Do

func (g *Group[T]) Do(key string, fn func() (T, error)) (v T, err error, shared bool)

func (*Group[T]) DoChan

func (g *Group[T]) DoChan(key string, fn func() (T, error)) <-chan Result[T]

func (*Group[T]) Forget

func (g *Group[T]) Forget(key string)

type Result

type Result[T any] struct {
	Val    T
	Err    error
	Shared bool
}

Jump to

Keyboard shortcuts

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