migrations

package
v1.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 14 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

func NewSchema

func NewSchema() storage.Schema

NewSchema creates a new schema document for the current version of the CNAB spec used by Porter.

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(collection string, opts storage.AggregateOptions, out interface{}) error

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Connect

func (m *Manager) Connect() error

func (*Manager) Count

func (m *Manager) Count(collection string, opts storage.CountOptions) (int64, 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 (m *Manager) GetDataStore() storage.Store

func (*Manager) Insert

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

func (*Manager) Migrate

func (m *Manager) Migrate() (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(collection string, opts storage.PatchOptions) error

func (*Manager) Remove

func (m *Manager) Remove(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(collection string, opts storage.UpdateOptions) error

func (*Manager) WriteSchema

func (m *Manager) WriteSchema() 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) 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

Jump to

Keyboard shortcuts

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