revsource

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Upscale vmv1.Flag = 1 << iota
	Downscale
)
View Source
const MaxRevisions = 100

MaxRevisions is the maximum number of revisions that can be stored in the RevisionSource. This is to prevent memory leaks. Upon reaching it, the oldest revisions are discarded.

Variables

This section is empty.

Functions

func Propagate

func Propagate(
	now time.Time,
	target vmv1.RevisionWithTime,
	currentSlot *vmv1.Revision,
	cb ObserveCallback,
)

Propagate sets the target revision to be current, optionally measuring the time it took for propagation.

Types

type ObserveCallback

type ObserveCallback func(dur time.Duration, flags vmv1.Flag)

type RevisionSource

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

RevisionSource can generate and observe revisions. Each Revision is a value and a set of flags (for meta-information). Once RevisionSource observes a previously generated Revision after some time, the time it took since that Revision was generated.

func NewRevisionSource

func NewRevisionSource(initialRevision int64, cb ObserveCallback) *RevisionSource

func (*RevisionSource) Next

func (c *RevisionSource) Next(now time.Time, flags vmv1.Flag) vmv1.Revision

func (*RevisionSource) Observe

func (c *RevisionSource) Observe(moment time.Time, rev vmv1.Revision) error

Jump to

Keyboard shortcuts

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