bundle

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectNotFound = errors.New("object not found")

ErrObjectNotFound error to be used when an object is not found.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString returns true if the string exists in the array and false otherwise.

func CreateSetFromSlice

func CreateSetFromSlice(slice []string) set.Set

CreateSetFromSlice returns a set contains all items in the given slice. if slice is nil, returns empty set.

Types

type Bundle

type Bundle interface {
	// UpdateObject function to update a single object inside a bundle.
	UpdateObject(object Object)
	// DeleteObject function to delete a single object inside a bundle.
	DeleteObject(object Object)
	// GetBundleVersion function to get bundle generation.
	GetBundleVersion() *status.BundleVersion
}

Bundle is an abstraction for managing different bundle types.

func NewGenericStatusBundle

func NewGenericStatusBundle(leafHubName string, incarnation uint64, manipulateObjFunc func(obj Object)) Bundle

NewGenericStatusBundle creates a new instance of GenericStatusBundle.

type DeltaStateBundle

type DeltaStateBundle interface {
	Bundle
	// GetTransportationID function to get bundle transportation ID to be attached to message-key during transportation.
	GetTransportationID() int
	// SyncState syncs the state of the delta-bundle with the full-state.
	SyncState()
	// Reset flushes the delta-state bundle's objects.
	Reset()
}

DeltaStateBundle abstracts the logic needed from the delta-state bundle.

type ExtractObjIDFunc

type ExtractObjIDFunc func(obj Object) (string, bool)

ExtractObjIDFunc a function type used to get the id of an object.

type GenericStatusBundle

type GenericStatusBundle struct {
	Objects       []Object              `json:"objects"`
	LeafHubName   string                `json:"leafHubName"`
	BundleVersion *status.BundleVersion `json:"bundleVersion"`
	// contains filtered or unexported fields
}

GenericStatusBundle is a bundle that is used to send to the hub of hubs the leaf CR as is except for fields that are not relevant in the hub of hubs like finalizers, etc. for bundles that require more specific behavior, it's required to implement your own status bundle struct.

func (*GenericStatusBundle) DeleteObject

func (bundle *GenericStatusBundle) DeleteObject(object Object)

DeleteObject function to delete a single object inside a bundle.

func (*GenericStatusBundle) GetBundleVersion

func (bundle *GenericStatusBundle) GetBundleVersion() *status.BundleVersion

GetBundleVersion function to get bundle version.

func (*GenericStatusBundle) UpdateObject

func (bundle *GenericStatusBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type Object

type Object interface {
	metav1.Object
	runtime.Object
}

Object is an interface for a single object inside a bundle.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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