migrations

package
v1.0.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

migrations package handles migrating Porter's stored documents when necessary.

Index

Constants

View Source
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

type Manager struct {
	*config.Config
	// contains filtered or unexported fields
}

Manager handles high level functions over Porter's storage systems such as migrating data formats.

func NewManager

func NewManager(c *config.Config, storage storage.Store) *Manager

NewManager creates a storage manager for a backing datastore.

func (*Manager) Aggregate

func (m *Manager) Aggregate(ctx context.Context, collection string, opts storage.AggregateOptions, out interface{}) error

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Connect

func (m *Manager) Connect(ctx context.Context) error

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) Count

func (m *Manager) Count(ctx context.Context, collection string, opts storage.CountOptions) (int64, error)

func (*Manager) EnsureIndex

func (m *Manager) EnsureIndex(ctx context.Context, opts storage.EnsureIndexOptions) error

func (*Manager) Find

func (m *Manager) Find(ctx context.Context, collection string, opts storage.FindOptions, out interface{}) error

func (*Manager) FindOne

func (m *Manager) FindOne(ctx context.Context, collection string, opts storage.FindOptions, out interface{}) error

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, collection string, opts storage.GetOptions, out interface{}) error

func (*Manager) GetDataStore

func (m *Manager) GetDataStore() storage.Store

func (*Manager) Insert

func (m *Manager) Insert(ctx context.Context, collection string, opts storage.InsertOptions) error

func (*Manager) Migrate

func (m *Manager) Migrate(ctx context.Context) (string, error)

Migrate executes a migration on any/all of Porter's storage sub-systems.

func (*Manager) MigrationRequired

func (m *Manager) MigrationRequired() bool

MigrationRequired determines if a migration of Porter's storage system is necessary.

func (*Manager) Patch

func (m *Manager) Patch(ctx context.Context, collection string, opts storage.PatchOptions) error

func (*Manager) Remove

func (m *Manager) Remove(ctx context.Context, collection string, opts storage.RemoveOptions) error

func (*Manager) ShouldMigrateClaims

func (m *Manager) ShouldMigrateClaims() bool

ShouldMigrateClaims determines if the claims storage system requires a migration.

func (*Manager) ShouldMigrateCredentials

func (m *Manager) ShouldMigrateCredentials() bool

ShouldMigrateCredentials determines if the credentials storage system requires a migration.

func (*Manager) ShouldMigrateParameters

func (m *Manager) ShouldMigrateParameters() bool

ShouldMigrateParameters determines if the parameter set documents requires a migration.

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, collection string, opts storage.UpdateOptions) error

func (*Manager) WriteSchema

func (m *Manager) WriteSchema(ctx context.Context) error

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) 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.

Jump to

Keyboard shortcuts

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