util

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationIDFrom added in v1.13.0

func ApplicationIDFrom(ctx context.Context) (string, bool)

ApplicationIDFrom returns the value of the ApplicationID key on the ctx

func ApplicationIDValue added in v1.13.0

func ApplicationIDValue(ctx context.Context) string

ApplicationIDValue returns the value of the applicationID key on the ctx, or the empty string if none

func GetMessageAPIVersion added in v1.10.0

func GetMessageAPIVersion(msg *beehiveModel.Message) string

GetMessageUID returns the UID of the object in message

func GetMessageResourceType

func GetMessageResourceType(msg *beehiveModel.Message) string

GetMessageUID returns the UID of the object in message

func SetMetaType

func SetMetaType(obj runtime.Object) error

MetaType is generally consisted of apiversion, kind like: { apiVersion: apps/v1 kind: Deployments } TODO: support crd

func UnsafeKindToResource

func UnsafeKindToResource(k string) string

func UnsafeResourceToKind

func UnsafeResourceToKind(r string) string

Sometimes, we need guess kind according to resource: 1. In most cases, is like pods to Pod, 2. In some unusual cases, requires special treatment like endpoints to Endpoints

func UnstructuredAttr

func UnstructuredAttr(obj runtime.Object) (labels.Set, fields.Set, error)

func WithApplicationID added in v1.13.0

func WithApplicationID(parent context.Context, appID string) context.Context

WithApplicationID returns a copy of parent in which the applicationID value is set

Types

This section is empty.

Jump to

Keyboard shortcuts

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