util

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: GPL-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 Cycler added in v0.5.0

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

Cycler stores a value and an accompanying io.Closer. When the value is set, the closer associated with the previous value is closed.

func (*Cycler[T]) Close added in v0.5.0

func (this *Cycler[T]) Close() error

Close closes the associated closer early.

func (*Cycler[T]) Set added in v0.5.0

func (this *Cycler[T]) Set(value T, closer io.Closer) (err error)

Set sets the value and associated closer, closing the previous one.

func (*Cycler[T]) Value added in v0.5.0

func (this *Cycler[T]) Value() T

Value returns the cycler's value.

Jump to

Keyboard shortcuts

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