refctr

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.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 Counter

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

func (*Counter) Dec

func (r *Counter) Dec(release func())

Dec decrements the counter and calls the release function, if this is the last reference.

func (*Counter) Inc

func (r *Counter) Inc(init func() error) (err error)

Inc increments the counter and calls the init function, if this is the first reference. The call returns an error only if init call has failed, and the reference has not been incremented.

Jump to

Keyboard shortcuts

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