utilmarshal

package
v0.0.0-...-070373f Latest Latest
Warning

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

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

Documentation

Overview

Utilities for unmarshalling in config files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSetTo

func IsSetTo[T comparable](opt Optional[T], t T) bool

Types

type ObjectFilter

type ObjectFilter struct {
	Cluster   Optional[StringFilter] `json:"cluster"`
	Group     Optional[StringFilter] `json:"group"`
	Resource  Optional[StringFilter] `json:"resource"`
	Namespace Optional[StringFilter] `json:"namespace"`
	Name      Optional[StringFilter] `json:"name"`
}

func (*ObjectFilter) Matches

func (filter *ObjectFilter) Matches(key utilobject.Key) bool

type Optional

type Optional[T any] struct {
	IsSet bool
	Value T
}

func (Optional[T]) GetOr

func (opt Optional[T]) GetOr(defaultValue T) T

func (*Optional[T]) UnmarshalJSON

func (v *Optional[T]) UnmarshalJSON(buf []byte) error

type StringFilter

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

func (*StringFilter) Matches

func (f *StringFilter) Matches(subject string) bool

func (*StringFilter) UnmarshalJSON

func (f *StringFilter) UnmarshalJSON(buf []byte) error

Jump to

Keyboard shortcuts

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