Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrObjectNotFound = errors.New("object not found")
ErrObjectNotFound error to be used when an object is not found.
Functions ¶
func ContainsString ¶
ContainsString returns true if the string exists in the array and false otherwise.
func CreateSetFromSlice ¶
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() *statusbundle.BundleVersion }
Bundle is an abstraction for managing different bundle types.
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 ¶
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 *statusbundle.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() *statusbundle.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.