Documentation ¶
Overview ¶
Package fields defines and matches common struct fields.
Index ¶
- Constants
- func Has(o types.Object, m ...Matcher) bool
- type Matcher
- func HasFieldThat(m ...Matcher) Matcher
- func IsEmbedded() Matcher
- func IsItems() Matcher
- func IsListMeta() Matcher
- func IsNamed(name string) Matcher
- func IsObjectMeta() Matcher
- func IsProviderConfigSpec() Matcher
- func IsProviderConfigStatus() Matcher
- func IsProviderConfigUsage() Matcher
- func IsResourceSpec() Matcher
- func IsResourceStatus() Matcher
- func IsSlice() Matcher
- func IsSpec() Matcher
- func IsSpecTemplate() Matcher
- func IsStatus() Matcher
- func IsTypeMeta() Matcher
- func IsTypeNamed(typeNameSuffix, name string) Matcher
Constants ¶
const ( NameTypeMeta = "TypeMeta" NameObjectMeta = "ObjectMeta" NameListMeta = "ListMeta" NameSpec = "Spec" NameSpecTemplate = "SpecTemplate" NameStatus = "Status" NameResourceSpec = "ResourceSpec" NameResourceStatus = "ResourceStatus" NameProviderConfigSpec = "ProviderConfigSpec" NameProviderConfigStatus = "ProviderConfigStatus" NameProviderConfigUsage = "ProviderConfigUsage" NameItems = "Items" )
Field names.
const ( TypeSuffixTypeMeta = "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta" TypeSuffixObjectMeta = "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta" TypeSuffixListMeta = "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta" TypeSuffixSpec = NameSpec TypeSuffixSpecTemplate = NameSpecTemplate TypeSuffixStatus = NameStatus TypeSuffixResourceSpec = "github.com/crossplane/crossplane-runtime/apis/common/v1.ResourceSpec" TypeSuffixResourceStatus = "github.com/crossplane/crossplane-runtime/apis/common/v1.ResourceStatus" TypeSuffixProviderConfigSpec = "github.com/crossplane/crossplane-runtime/apis/common/v1.ProviderConfigSpec" TypeSuffixProviderConfigStatus = "github.com/crossplane/crossplane-runtime/apis/common/v1.ProviderConfigStatus" TypeSuffixProviderConfigUsage = "github.com/crossplane/crossplane-runtime/apis/common/v1.ProviderConfigUsage" )
Field type suffixes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matcher ¶
A Matcher is a function that returns true if the supplied Var (assumed to be a struct field) matches its requirements.
func HasFieldThat ¶
HasFieldThat returns a Matcher that returns true if the supplied field is a struct that matches the supplied field matchers.
func IsEmbedded ¶
func IsEmbedded() Matcher
IsEmbedded returns a Matcher that returns true if the supplied field is embedded.
func IsItems ¶
func IsItems() Matcher
IsItems returns a Matcher that returns true if the supplied field appears to be the Items of a Kubernetes list.
func IsListMeta ¶
func IsListMeta() Matcher
IsListMeta returns a Matcher that returns true if the supplied field appears to be Kubernetes list metadata.
func IsNamed ¶
IsNamed returns a Matcher that returns true if the supplied field has the supplied name.
func IsObjectMeta ¶
func IsObjectMeta() Matcher
IsObjectMeta returns a Matcher that returns true if the supplied field appears to be Kubernetes object metadata.
func IsProviderConfigSpec ¶
func IsProviderConfigSpec() Matcher
IsProviderConfigSpec returns a Matcher that returns true if the supplied field appears to be a Crossplane provider config spec.
func IsProviderConfigStatus ¶
func IsProviderConfigStatus() Matcher
IsProviderConfigStatus returns a Matcher that returns true if the supplied field appears to be a Crossplane provider config status.
func IsProviderConfigUsage ¶
func IsProviderConfigUsage() Matcher
IsProviderConfigUsage returns a Matcher that returns true if the supplied field appears to be a Crossplane provider config usage.
func IsResourceSpec ¶
func IsResourceSpec() Matcher
IsResourceSpec returns a Matcher that returns true if the supplied field appears to be a Crossplane managed resource spec.
func IsResourceStatus ¶
func IsResourceStatus() Matcher
IsResourceStatus returns a Matcher that returns true if the supplied field appears to be a Crossplane managed resource status.
func IsSlice ¶
func IsSlice() Matcher
IsSlice returns a Matcher that returns true if the supplied field is a slice.
func IsSpec ¶
func IsSpec() Matcher
IsSpec returns a Matcher that returns true if the supplied field appears to be a Kubernetes resource spec.
func IsSpecTemplate ¶
func IsSpecTemplate() Matcher
IsSpecTemplate returns a Matcher that returns true if the supplied field appears to be a Crossplane resource class spec template.
func IsStatus ¶
func IsStatus() Matcher
IsStatus returns a Matcher that returns true if the supplied field appears to be a Kubernetes resource status.
func IsTypeMeta ¶
func IsTypeMeta() Matcher
IsTypeMeta returns a Matcher that returns true if the supplied field appears to be Kubernetes type metadata.
func IsTypeNamed ¶
IsTypeNamed returns a Matcher that returns true if the supplied field has the supplied type name suffix and name.