items

package
v0.0.0-...-d3fa782 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package items provides the data types needed to implement a filter cache for filtering out events that are older than the current version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Age

type Age int8

Age represents the state of the item compared to the cacheable object.

const (
	// Equal represents the item is equal to the cacheable object.
	Equal Age = 0
	// Older represents the item is older than the cacheable object.
	Older Age = -1
	// Newer represents the item is newer than the cacheable object.
	Newer Age = 1
)

func (Age) String

func (i Age) String() string

type Item

type Item struct {
	// ResourceVersion is the resource version of the object.
	ResourceVersion string
	// Generation is the generation of the object.
	Generation int64
}

Item represents the needed fields to filter an object. Field aligned for storage reduction.

func New

func New(o Object) Item

New creates a new Item from a Cacheable object.

func (Item) IsState

func (i Item) IsState(c Object) Age

IsState returns the state of the item compared to the cacheable object. If the item is equal to the cacheable object, it returns Equal. If the item is newer than the cacheable object, it returns Newer. If the item is older than the cacheable object, it returns Older.

type Object

type Object interface {
	GetUID() types.UID
	GetResourceVersion() string
	GetGeneration() int64
}

Object represent an object that can be filtered. All K8 objects implement this interface.

Jump to

Keyboard shortcuts

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