diff

package
v0.150.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changes

type Changes[K comparable, T Hasher[K]] struct {
	// contains filtered or unexported fields
}

Changes is the result of the difference between two maps – items that are added and items that are removed This map is used to reconcile state differences.

func Maps

func Maps[K comparable, T Hasher[K]](current, m map[K]T) Changes[K, T]

Maps generates Changes for two maps with the same type signature by checking for any removals and then checking for additions. TODO: This doesn't need to create maps, it can return slices only. This function doesn't need to insert the values.

func NewChanges

func NewChanges[K comparable, T Hasher[K]](additions, removals map[K]T) Changes[K, T]

func (Changes[K, T]) Additions

func (c Changes[K, T]) Additions() map[K]T

func (Changes[K, T]) Removals

func (c Changes[K, T]) Removals() map[K]T

type Hasher

type Hasher[K comparable] interface {
	Hash() K
}

Jump to

Keyboard shortcuts

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