diff

package
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 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[T Hasher] 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[T Hasher](current, new map[string]T) Changes[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[T Hasher](additions map[string]T, removals map[string]T) Changes[T]

func (Changes[T]) Additions

func (c Changes[T]) Additions() map[string]T

func (Changes[T]) Removals

func (c Changes[T]) Removals() map[string]T

type Hasher

type Hasher interface {
	Hash() string
}

Jump to

Keyboard shortcuts

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