kubernetes: k8s.io/kubernetes/third_party/forked/golang/reflect Index | Files

package reflect

import "k8s.io/kubernetes/third_party/forked/golang/reflect"

Package reflect is a fork of go's standard library reflection package, which allows for deep equal with equality functions defined.

This package is copied from Go library reflect/type.go. The struct tag library provides no way to extract the list of struct tags, only a specific tag


Package Files

deep_equal.go type.go

type Equalities Uses

type Equalities map[reflect.Type]reflect.Value

Equalities is a map from type to a function comparing two values of that type.

func EqualitiesOrDie Uses

func EqualitiesOrDie(funcs ...interface{}) Equalities

For convenience, panics on errrors

func (Equalities) AddFunc Uses

func (e Equalities) AddFunc(eqFunc interface{}) error

AddFunc uses func as an equality function: it must take two parameters of the same type, and return a boolean.

func (Equalities) AddFuncs Uses

func (e Equalities) AddFuncs(funcs ...interface{}) error

AddFuncs is a shortcut for multiple calls to AddFunc.

func (Equalities) DeepDerivative Uses

func (e Equalities) DeepDerivative(a1, a2 interface{}) bool

DeepDerivative is similar to DeepEqual except that unset fields in a1 are ignored (not compared). This allows us to focus on the fields that matter to the semantic comparison.

The unset fields include a nil pointer and an empty string.

func (Equalities) DeepEqual Uses

func (e Equalities) DeepEqual(a1, a2 interface{}) bool

DeepEqual is like reflect.DeepEqual, but focused on semantic equality instead of memory equality.

It will use e's equality functions if it finds types that match.

An empty slice *is* equal to a nil slice for our purposes; same for maps.

Unexported field members cannot be compared and will cause an informative panic; you must add an Equality function for these types.

type StructTag Uses

type StructTag struct {
    Name  string
    Value string

func (StructTag) String Uses

func (t StructTag) String() string

type StructTags Uses

type StructTags []StructTag

func ParseStructTags Uses

func ParseStructTags(tag string) (StructTags, error)

ParseStructTags returns the full set of fields in a struct tag in the order they appear in the struct tag.

func (StructTags) Has Uses

func (tags StructTags) Has(name string) bool

func (StructTags) String Uses

func (tags StructTags) String() string

Package reflect imports 4 packages (graph) and is imported by 9 packages. Updated 2019-11-20. Refresh now. Tools for package owners.