Documentation ¶
Overview ¶
migrations package handles migrating Porter's stored documents when necessary.
Index ¶
- Constants
- func NewSchema() storage.Schema
- type Manager
- func (m *Manager) Aggregate(collection string, opts storage.AggregateOptions, out interface{}) error
- func (m *Manager) Close() error
- func (m *Manager) Connect() error
- func (m *Manager) Count(collection string, opts storage.CountOptions) (int64, error)
- func (m *Manager) EnsureIndex(opts storage.EnsureIndexOptions) error
- func (m *Manager) Find(collection string, opts storage.FindOptions, out interface{}) error
- func (m *Manager) FindOne(collection string, opts storage.FindOptions, out interface{}) error
- func (m *Manager) Get(collection string, opts storage.GetOptions, out interface{}) error
- func (m *Manager) GetDataStore() storage.Store
- func (m *Manager) Insert(collection string, opts storage.InsertOptions) error
- func (m *Manager) Migrate() (string, error)
- func (m *Manager) MigrationRequired() bool
- func (m *Manager) Patch(collection string, opts storage.PatchOptions) error
- func (m *Manager) Remove(collection string, opts storage.RemoveOptions) error
- func (m *Manager) ShouldMigrateClaims() bool
- func (m *Manager) ShouldMigrateCredentials() bool
- func (m *Manager) ShouldMigrateParameters() bool
- func (m *Manager) Update(collection string, opts storage.UpdateOptions) error
- func (m *Manager) WriteSchema() error
- type TestManager
Constants ¶
const ( // CollectionConfig is the collection that stores Porter configuration documents // such as the storage schema. CollectionConfig = "config" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
Manager handles high level functions over Porter's storage systems such as migrating data formats.
func NewManager ¶
NewManager creates a storage manager for a backing datastore.
func (*Manager) Aggregate ¶
func (m *Manager) Aggregate(collection string, opts storage.AggregateOptions, out interface{}) error
func (*Manager) EnsureIndex ¶
func (m *Manager) EnsureIndex(opts storage.EnsureIndexOptions) error
func (*Manager) Find ¶
func (m *Manager) Find(collection string, opts storage.FindOptions, out interface{}) error
func (*Manager) FindOne ¶
func (m *Manager) FindOne(collection string, opts storage.FindOptions, out interface{}) error
func (*Manager) Get ¶
func (m *Manager) Get(collection string, opts storage.GetOptions, out interface{}) error
func (*Manager) GetDataStore ¶
func (*Manager) Insert ¶
func (m *Manager) Insert(collection string, opts storage.InsertOptions) error
func (*Manager) MigrationRequired ¶
MigrationRequired determines if a migration of Porter's storage system is necessary.
func (*Manager) Remove ¶
func (m *Manager) Remove(collection string, opts storage.RemoveOptions) error
func (*Manager) ShouldMigrateClaims ¶
ShouldMigrateClaims determines if the claims storage system requires a migration.
func (*Manager) ShouldMigrateCredentials ¶
ShouldMigrateCredentials determines if the credentials storage system requires a migration.
func (*Manager) ShouldMigrateParameters ¶
ShouldMigrateParameters determines if the parameter set documents requires a migration.
func (*Manager) Update ¶
func (m *Manager) Update(collection string, opts storage.UpdateOptions) error
func (*Manager) WriteSchema ¶
WriteSchema updates the schema with the most recent version then writes it to disk.
type TestManager ¶
type TestManager struct { *Manager // contains filtered or unexported fields }
func NewTestManager ¶
func NewTestManager(c *config.TestConfig) *TestManager
func (*TestManager) SetSchema ¶
func (m *TestManager) SetSchema(schema storage.Schema)
SetSchema allows tests to pre-emptively set the schema document.
func (*TestManager) Teardown ¶
func (m *TestManager) Teardown() error