store

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

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)
	GetActualStateUpdater() actual.StateUpdater
	ResetActualState() error
}

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 {
	GetRevision(gen runtime.Generation) (*engine.Revision, error)
	GetFirstRevisionForPolicy(policyGen runtime.Generation) (*engine.Revision, error)
	GetAllRevisionsForPolicy(policyGen runtime.Generation) ([]*engine.Revision, error)
	NewRevision(policyGen runtime.Generation) (*engine.Revision, error)
	SaveRevision(revision *engine.Revision) error
	UpdateRevision(revision *engine.Revision) error
	GetRevisionProgressUpdater(revision *engine.Revision) progress.Indicator
}

Revision represents database operations for Revision object

Directories

Path Synopsis
Package core allows to persist Aptomi engine objects into the object store.
Package core allows to persist Aptomi engine objects into the object store.
generic

Jump to

Keyboard shortcuts

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