package
0.0.0-20231126024412-02539191b02e
Repository: https://github.com/mjpitz/myago.git
Documentation: pkg.go.dev

# README

lazy

import go.pitz.tech/lib/lazy

Usage

type Once

type Once struct {
	// Loader is a function that returns an object and optional error. It conditionally accepts a context value.
	Loader interface{}
}

Once will attempt to load a value until one is loaded.

func (*Once) Get

func (o *Once) Get(ctx context.Context) (interface{}, error)

Get returns the loaded value if set or an error should one occur.

# Structs

Once will attempt to load a value until one is loaded.