once

package
v0.0.0-...-a6a3a47 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: AGPL-3.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 Init

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

Init represents the structure.

func (*Init) Do

func (l *Init) Do(f func() error) error

Do is similar to sync.Once.Do - makes one successful call to the function. ie, it invokes the function if it is not successful yet.

func (*Init) DoWithContext

func (l *Init) DoWithContext(ctx context.Context, f func(context.Context) error) error

DoWithContext is similar to Do except that it accepts a context as an argument to be passed.

Jump to

Keyboard shortcuts

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