lazy

package
v1.22.0-rc1-beta Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0, MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lazy

type Lazy[T any] struct {
	Get func() (T, error)
	// contains filtered or unexported fields
}

func MakeLazy

func MakeLazy[T any](get func() (T, error)) *Lazy[T]

func (*Lazy[T]) Val

func (l *Lazy[T]) Val() (T, error)

type LazyCtx

type LazyCtx[T any] struct {
	Get func(context.Context) (T, error)
	// contains filtered or unexported fields
}

func MakeLazyCtx

func MakeLazyCtx[T any](get func(ctx context.Context) (T, error)) *LazyCtx[T]

func (*LazyCtx[T]) Val

func (l *LazyCtx[T]) Val(ctx context.Context) (T, error)

Jump to

Keyboard shortcuts

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