codec

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// CloudEventsDataTypeAnnotationKey is the key of the cloudevents data type annotation.
	CloudEventsDataTypeAnnotationKey = "cloudevents.open-cluster-management.io/datatype"

	// CloudEventsDataTypeAnnotationKey is the key of the cloudevents original source annotation.
	CloudEventsOriginalSourceAnnotationKey = "cloudevents.open-cluster-management.io/originalsource"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ManifestBundleCodec

type ManifestBundleCodec struct{}

ManifestBundleCodec is a codec to encode/decode a ManifestWork/cloudevent with ManifestBundle for an agent.

func NewManifestBundleCodec

func NewManifestBundleCodec() *ManifestBundleCodec

func (*ManifestBundleCodec) Decode

Decode a cloudevent whose data is ManifestBundle to a ManifestWork.

func (*ManifestBundleCodec) Encode

func (c *ManifestBundleCodec) Encode(source string, eventType types.CloudEventsType, work *workv1.ManifestWork) (*cloudevents.Event, error)

Encode the status of a ManifestWork to a cloudevent with ManifestBundleStatus.

func (*ManifestBundleCodec) EventDataType

func (c *ManifestBundleCodec) EventDataType() types.CloudEventsDataType

EventDataType always returns the event data type `io.open-cluster-management.works.v1alpha1.manifestbundles`.

type ManifestCodec

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

ManifestCodec is a codec to encode/decode a ManifestWork/cloudevent with ManifestBundle for an agent.

func NewManifestCodec

func NewManifestCodec(restMapper meta.RESTMapper) *ManifestCodec

func (*ManifestCodec) Decode

Decode a cloudevent whose data is Manifest to a ManifestWork.

func (*ManifestCodec) Encode

func (c *ManifestCodec) Encode(source string, eventType types.CloudEventsType, work *workv1.ManifestWork) (*cloudevents.Event, error)

Encode the status of a ManifestWork to a cloudevent with ManifestStatus.

func (*ManifestCodec) EventDataType

func (c *ManifestCodec) EventDataType() types.CloudEventsDataType

EventDataType returns the event data type for `io.open-cluster-management.works.v1alpha1.manifests`.

Jump to

Keyboard shortcuts

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