Collapsed repetitive code into generic functions.

Establishing patterns for individual objects, discovering designs to collapse what would be an obscene amount of repetitive code.
This commit is contained in:
Dave Shanley
2022-09-30 10:39:35 -04:00
parent cb7df7c9b2
commit ba37ca4e29
8 changed files with 390 additions and 126 deletions

View File

@@ -22,6 +22,11 @@ type HasValueNode[T any] interface {
*T
}
// HasExtensions is implemented by any object that exposes extensions
type HasExtensions[T any] interface {
GetExtensions() map[KeyReference[string]]ValueReference[any]
}
// HasValue is implemented by NodeReference and ValueReference to return the yaml.Node backing the value.
type HasValue[T any] interface {
GetValue() T