resource

package
v0.0.0-...-ebf3c7b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Overview

Package resource describes require for object lifecycle management. Both Finalizer and Closer have similar concepts, they both exist so that different types can be used for resource cleanup with different method names as for some things like iterators, the verb close makes more sense than finalize and is more consistent with other types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closer

type Closer interface {
	Close()
}

Closer is an object that can be closed.

type CloserFn

type CloserFn func()

CloserFn is a function literal that is a closer.

func (CloserFn) Close

func (fn CloserFn) Close()

Close will call the function literal as a closer.

type Finalizer

type Finalizer interface {
	Finalize()
}

Finalizer finalizes a checked resource.

type FinalizerFn

type FinalizerFn func()

FinalizerFn is a function literal that is a finalizer.

func (FinalizerFn) Finalize

func (fn FinalizerFn) Finalize()

Finalize will call the function literal as a finalizer.

Jump to

Keyboard shortcuts

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