utilobject

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Cluster   string `json:"cluster"`
	Group     string `json:"group"`
	Resource  string `json:"resource"`
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
}

func FromMap

func FromMap(tags map[string]string) (key Key, ok bool)

func (Key) AsFields

func (key Key) AsFields(prefix string) logrus.Fields

func (Key) Clone

func (key Key) Clone() Key

func (Key) GroupResource

func (key Key) GroupResource() schema.GroupResource

func (Key) String

func (key Key) String() string

type Rich

type Rich struct {
	VersionedKey

	Uid types.UID

	Raw *unstructured.Unstructured `json:"-"`
}

func RichFromAudit

func RichFromAudit(object *auditv1.ObjectReference, cluster string) Rich

func RichFromUnstructured

func RichFromUnstructured(
	uns *unstructured.Unstructured,
	cluster string,
	gvr schema.GroupVersionResource,
) Rich

func (Rich) AsFields

func (ref Rich) AsFields(prefix string) logrus.Fields

func (Rich) Clone

func (ref Rich) Clone() Rich

Returns a new Rich reference with all strings cloned again to ensure this object does not reference more data than it needs.

Does not copy the Raw field.

func (Rich) String

func (ref Rich) String() string

type VersionedKey

type VersionedKey struct {
	Key
	Version string `json:"version"`
}

func FromObject

func FromObject(object metav1.Object, cluster string, gvr schema.GroupVersionResource) VersionedKey

func (VersionedKey) Clone

func (key VersionedKey) Clone() VersionedKey

func (VersionedKey) GroupVersion

func (key VersionedKey) GroupVersion() schema.GroupVersion

func (VersionedKey) GroupVersionResource

func (key VersionedKey) GroupVersionResource() schema.GroupVersionResource

Jump to

Keyboard shortcuts

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