decoder

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package decoder contains the functions that decode a JSON stream into a structured Kubernetes resource

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBackupLenient added in v0.2.0

func DecodeBackupLenient(backupDefinition []byte) (*apiv1.Backup, error)

DecodeBackupLenient decodes a JSON representation of a backup.

func DecodeBackupStrict added in v0.2.0

func DecodeBackupStrict(backupDefinition []byte) (*apiv1.Backup, error)

DecodeBackupStrict decodes a JSON representation of a backup.

func DecodeClusterLenient added in v0.2.0

func DecodeClusterLenient(clusterJSON []byte) (*apiv1.Cluster, error)

DecodeClusterLenient decodes a JSON representation of a cluster.

func DecodeClusterStrict added in v0.2.0

func DecodeClusterStrict(clusterJSON []byte) (*apiv1.Cluster, error)

DecodeClusterStrict decodes a JSON representation of a cluster.

func DecodeObjectLenient added in v0.2.0

func DecodeObjectLenient(objectJSON []byte, object runtime.Object) error

DecodeObjectLenient decodes a JSON representation of an object.

func DecodeObjectStrict added in v0.2.0

func DecodeObjectStrict(objectJSON []byte, object runtime.Object, expectedGVK schema.GroupVersionKind) error

DecodeObjectStrict decodes a JSON representation of an object.

func DecodePodJSON

func DecodePodJSON(podJSON []byte) (*corev1.Pod, error)

DecodePodJSON decodes a JSON representation of a pod.

Types

type WrongObjectTypeError

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

WrongObjectTypeError is raised when the GVK of the passed JSON object is different from the expected one.

func (*WrongObjectTypeError) Error

func (e *WrongObjectTypeError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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