releasable

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package releasable allows process-wide tracking of objects that need to be released.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active() map[ItemKind]map[interface{}]string

Active returns the map of all active items.

func Created

func Created(kind ItemKind, itemID interface{})

Created should be called whenever an item is created. If tracking is enabled, it captures the stack trace of the current goroutine and stores it in a map.

func DisableTracking

func DisableTracking(kind ItemKind)

DisableTracking disables tracking of the given item type.

func EnableTracking

func EnableTracking(kind ItemKind)

EnableTracking enables tracking of the given item type.

func Released

func Released(kind ItemKind, itemID interface{})

Released should be called whenever an item is released.

func Verify

func Verify() error

Verify returns error if not all releasable resources have been released.

Types

type ItemKind

type ItemKind string

ItemKind identifies the kind of a releasable item, e.g. "connection", "cache", etc.

Jump to

Keyboard shortcuts

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