stale

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStaleAny

func IsStaleAny(os ...any) bool

IsStaleAny reports whether any of the os is marked as stale.

func MarkStale

func MarkStale(os ...any)

MarkStale will mark any of the oses as stale, if possible.

Types

type AtomicStaler

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

func (*AtomicStaler) IsStale

func (s *AtomicStaler) IsStale() bool

func (*AtomicStaler) MarkStale

func (s *AtomicStaler) MarkStale()

type Info

type Info interface {
	IsStale() bool
}

Info tells if a resource is marked as stale.

type Marker

type Marker interface {
	MarkStale()
}

Marker marks a Resource as stale.

type Staler

type Staler interface {
	Marker
	Info
}

Staler controls stale state of a Resource. A stale resource should be discarded.

type Value

type Value[V any] struct {
	// The value.
	Value V

	// IsStaleFunc reports whether the value is stale.
	IsStaleFunc func() bool
}

func (*Value[V]) IsStale

func (s *Value[V]) IsStale() bool

Jump to

Keyboard shortcuts

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