-
Notifications
You must be signed in to change notification settings - Fork 24
/
bundle.go
31 lines (27 loc) · 1.25 KB
/
bundle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package status
// CreateBundleFunction function that specifies how to create a bundle.
type CreateBundleFunction func() Bundle
// Bundle bundles together a set of objects that were sent from leaf hubs via transport layer.
type Bundle interface {
// GetLeafHubName returns the leaf hub name that sent the bundle.
GetLeafHubName() string
// GetObjects returns the objects in the bundle.
GetObjects() []interface{}
// GetVersion returns the bundle version.
GetVersion() *BundleVersion
}
// DependantBundle is a bundle that depends on a different bundle.
// to support bundles dependencies additional function is required - GetDependencyVersion, in order to start
// processing the dependant bundle only after its required dependency (with required version) was processed.
type DependantBundle interface {
Bundle
// GetDependencyVersion returns the bundle dependency required version.
GetDependencyVersion() *BundleVersion
}
// DeltaStateBundle abstracts the functionality required from a Bundle to be used as Delta-State bundle.
type DeltaStateBundle interface {
DependantBundle
// InheritEvents inherits the events in an older delta-bundle into the receiver (in-case of conflict, the receiver
// is the source of truth).
InheritEvents(olderBundle Bundle) error
}