db

package
v0.0.0-...-9f61de0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Reconciled condition tracks the state of the reconcile operation.
	// "True" indicates that the object has been successfully applied.
	// "False" indicates a non-transitive error prevents reconciliation from succeeding.
	StatusMessageReconciled = "Reconciled"
	// Deleted condition tracks the if deletion succeeded.
	// "True" indicates that the object has been successfully removed from the target.
	// "False" indicates that deletion is blocked or did not yet succeed.
	StatusMessageDeleted = "Deleted"
)
View Source
const ConsumerTable = "Consumers"
View Source
const ResourceTable = "Resources"

Variables

This section is empty.

Functions

func GetConsumer

func GetConsumer(consumerID string) (*v1.Consumer, error)

func PutConsumer

func PutConsumer(c *v1.Consumer) error

func PutResource

func PutResource(r *Resource) error

func SetStatusResource

func SetStatusResource(resourceID string, statusData []byte) error

Types

type ErrorNotFound

type ErrorNotFound struct{}

func (*ErrorNotFound) Error

func (e *ErrorNotFound) Error() string

type MessageMeta

type MessageMeta struct {
	// Unix Timestamp (UTC) at which time
	// the message was sent to the broker.
	SentTimestamp int64 `json:"sentTimestamp"`

	// Server-side opaque corelation ID.
	// MUST be passed back in status responses unchanged.
	ResourceGenerationID int64 `json:"resourceGenerationID"`
}

type ReconcileStatus

type ReconcileStatus struct {
	// MAY when object exists/
	// Object generation as observed on the target.
	// .metadata.generation
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// MAY when object exists.
	// RFC3339 Timestamp.
	// .metadata.creationTimestamp as observed on the target.
	CreationTimestamp string `json:"creationTimestamp,omitempty"`
	// Kubernetes style status conditions,
	// describing the state of the object on the target.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

type Resource

type Resource struct {
	Id                   string
	ConsumerId           string
	ResourceGenerationID int64
	Object               unstructured.Unstructured
	Status               StatusMessage
}

func GetResource

func GetResource(resourceID string) (*Resource, error)

type ResourceMessage

type ResourceMessage struct {
	MessageMeta `json:",inline"`

	Id         string `json:"-"`
	ConsumerId string `json:"-"`

	// Kubernetes Manifest to apply on the target.
	Content *unstructured.Unstructured `json:"content"`
}

type StatusMessage

type StatusMessage struct {
	MessageMeta `json:",inline"`
	// agent status information.
	ReconcileStatus ReconcileStatus `json:"reconcileStatus"`
	// content status as observed on the target.
	ContentStatus map[string]interface{} `json:"contentStatus"`
}

Jump to

Keyboard shortcuts

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