singleton

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Singleton

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

func NewSingleton

func NewSingleton[T any]() *Singleton[T]

func (*Singleton[T]) Get

func (s *Singleton[T]) Get(initFunc func() T) T

func (*Singleton[T]) GetWithCloser

func (s *Singleton[T]) GetWithCloser(initFunc func() (T, func(), error)) (T, func())

Jump to

Keyboard shortcuts

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