Documentation
¶
Overview ¶
migrations package handles migrating Porter's stored documents when necessary.
Index ¶
- Constants
- type Manager
- func (m *Manager) Aggregate(ctx context.Context, collection string, opts storage.AggregateOptions, ...) error
- func (m *Manager) Close() error
- func (m *Manager) Connect(ctx context.Context) error
- func (m *Manager) Count(ctx context.Context, collection string, opts storage.CountOptions) (int64, error)
- func (m *Manager) EnsureIndex(ctx context.Context, opts storage.EnsureIndexOptions) error
- func (m *Manager) Find(ctx context.Context, collection string, opts storage.FindOptions, ...) error
- func (m *Manager) FindOne(ctx context.Context, collection string, opts storage.FindOptions, ...) error
- func (m *Manager) Get(ctx context.Context, collection string, opts storage.GetOptions, ...) error
- func (m *Manager) GetDataStore() storage.Store
- func (m *Manager) Insert(ctx context.Context, collection string, opts storage.InsertOptions) error
- func (m *Manager) Migrate(ctx context.Context) (string, error)
- func (m *Manager) MigrationRequired() bool
- func (m *Manager) Patch(ctx context.Context, collection string, opts storage.PatchOptions) error
- func (m *Manager) Remove(ctx context.Context, 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(ctx context.Context, collection string, opts storage.UpdateOptions) error
- func (m *Manager) WriteSchema(ctx context.Context) 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 ¶
This section is empty.
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) Connect ¶
Connect initializes storage manager for use. The manager itself is responsible for ensuring it was called. Close is called automatically when the manager is used by Porter.
func (*Manager) EnsureIndex ¶
func (*Manager) GetDataStore ¶
func (*Manager) MigrationRequired ¶
MigrationRequired determines if a migration of Porter's storage system is necessary.
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.
type TestManager ¶
type TestManager struct { *Manager // contains filtered or unexported fields }
func NewTestManager ¶
func NewTestManager(c *config.TestConfig) *TestManager
func (*TestManager) Close ¶
func (m *TestManager) Close() error
func (*TestManager) SetSchema ¶
func (m *TestManager) SetSchema(schema storage.Schema)
SetSchema allows tests to pre-emptively set the schema document.