Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Objects represents list of all storable objects Objects = runtime.AppendAll(engine.Objects, lang.PolicyObjects) )
Functions ¶
This section is empty.
Types ¶
type ActualState ¶
type ActualState interface {
GetActualState() (*resolve.PolicyResolution, error)
NewActualStateUpdater(*resolve.PolicyResolution) actual.StateUpdater
}
ActualState represents database operations for the actual state handling
type Core ¶
type Core interface {
Policy
Revision
ActualState
}
Core represents main object store interface that covers database operations for all objects
type Generic ¶
type Generic interface {
Open(config.DB) error
Close() error
Get(key string) (runtime.Storable, error)
GetGen(key string, gen runtime.Generation) (runtime.Versioned, error)
List(prefix string) ([]runtime.Storable, error)
ListGenerations(key string) ([]runtime.Storable, error)
// Save could create new object in db or create new generation for existing object
// todo(slukjanov): think about improving saving objects
Save(runtime.Storable) (updated bool, err error)
// Update always updates existing object in db and not creating new generation even for versioned objects
// todo(slukjanov): introduce "status" for objects and don't update version when only status changed
Update(runtime.Storable) (updated bool, err error)
Delete(key string) error
}
Generic is an interface which describes basic operations on storable objects in DB
type Policy ¶
type Policy interface {
GetPolicy(runtime.Generation) (*lang.Policy, runtime.Generation, error)
GetPolicyData(runtime.Generation) (*engine.PolicyData, error)
InitPolicy() error
UpdatePolicy(updated []lang.Base, performedBy string) (changed bool, data *engine.PolicyData, err error)
DeleteFromPolicy(deleted []lang.Base, performedBy string) (changed bool, data *engine.PolicyData, err error)
}
Policy represents database operations for Policy object
type Revision ¶
type Revision interface {
NewRevision(policyGen runtime.Generation, desiredState *resolve.PolicyResolution, recalculateAll bool) (*engine.Revision, error)
GetDesiredState(*engine.Revision) (*resolve.PolicyResolution, error)
GetRevision(gen runtime.Generation) (*engine.Revision, error)
UpdateRevision(revision *engine.Revision) error
NewRevisionResultUpdater(revision *engine.Revision) action.ApplyResultUpdater
GetFirstUnprocessedRevision() (*engine.Revision, error)
GetLastRevisionForPolicy(policyGen runtime.Generation) (*engine.Revision, error)
GetAllRevisionsForPolicy(policyGen runtime.Generation) ([]*engine.Revision, error)
}
Revision represents database operations for Revision object
Click to show internal directories.
Click to hide internal directories.