Documentation ¶
Overview ¶
migrations package handles migrating Porter's stored documents when necessary.
Index ¶
- Constants
- func WriteSchema(ctx context.Context, store storage.Store) (storage.Schema, error)
- type LegacyPluginAdapter
- func (m *LegacyPluginAdapter) Close() error
- func (m *LegacyPluginAdapter) Connect(ctx context.Context) error
- func (m *LegacyPluginAdapter) List(ctx context.Context, itemType string, group string) ([]string, error)
- func (m *LegacyPluginAdapter) Read(ctx context.Context, itemType string, name string) ([]byte, error)
- 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) Initialize(sanitizer *storage.Sanitizer)
- func (m *Manager) Insert(ctx context.Context, collection string, opts storage.InsertOptions) error
- func (m *Manager) Migrate(ctx context.Context, opts storage.MigrateOptions) error
- 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) Update(ctx context.Context, collection string, opts storage.UpdateOptions) error
- func (m *Manager) WriteSchema(ctx context.Context) error
- type Migration
- type SourceClaim
- type SourceCredentialSet
- type SourceParameterSet
- type SourceResult
- type SourceSchema
- 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 LegacyPluginAdapter ¶
type LegacyPluginAdapter struct {
// contains filtered or unexported fields
}
LegacyPluginAdapter can connect to a legacy Porter v0.38 storage plugin to retrieve data to migrate to the current version of Porter.
func NewLegacyPluginAdapter ¶
func NewLegacyPluginAdapter(c *config.Config, oldPorterHome string, storageName string) *LegacyPluginAdapter
func (*LegacyPluginAdapter) Close ¶
func (m *LegacyPluginAdapter) Close() error
func (*LegacyPluginAdapter) Connect ¶
func (m *LegacyPluginAdapter) Connect(ctx context.Context) error
Connect loads the legacy plugin specified by the source storage account.
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) Initialize ¶
Initialize configures the storage manager with additional configuration that wasn't available when the manager instance was created.
func (*Manager) Migrate ¶
Migrate executes a migration on any/all of Porter's storage sub-systems. You must call Initialize before calling Migrate.
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
Migration can connect to a legacy Porter v0.38 storage plugin migrate the data in the specified account into a target account compatible with the current version of Porter.
func NewMigration ¶
type SourceClaim ¶
type SourceClaim struct { // SchemaVersion is the version of the claim schema. SchemaVersion schema.Version `json:"schemaVersion"` // Id of the claim. ID string `json:"id"` // Installation name. Installation string `json:"installation"` // Revision of the installation. Revision string `json:"revision"` // Created timestamp of the claim. Created time.Time `json:"created"` // Action executed against the installation. Action string `json:"action"` // Bundle is the definition of the bundle. Bundle bundle.Bundle `json:"bundle"` // BundleReference is the canonical reference to the bundle used in the action. BundleReference string `json:"bundleReference,omitempty"` // Parameters are the key/value pairs that were passed in during the operation. Parameters map[string]interface{} `json:"parameters,omitempty"` // Custom extension data applicable to a given runtime. Custom interface{} `json:"custom,omitempty"` }
SourceClaim represents the file format of claim documents from v0.38
type SourceCredentialSet ¶
type SourceCredentialSet struct { // SchemaVersion is the version of the credential-set schema. SchemaVersion schema.Version `json:"schemaVersion" yaml:"schemaVersion"` // Name is the name of the credentialset. Name string `json:"name" yaml:"name"` // Created timestamp of the credentialset. Created time.Time `json:"created" yaml:"created"` // Modified timestamp of the credentialset. Modified time.Time `json:"modified" yaml:"modified"` // Credentials is a list of credential specs. Credentials []valuesource.Strategy `json:"credentials" yaml:"credentials"` }
SourceCredentialSet represents the file format of credential set documents from v0.38
type SourceParameterSet ¶
type SourceParameterSet struct { // SchemaVersion is the version of the parameter-set schema. SchemaVersion schema.Version `json:"schemaVersion" yaml:"schemaVersion"` // Name is the name of the parameter set. Name string `json:"name" yaml:"name"` // Created timestamp of the parameter set. Created time.Time `json:"created" yaml:"created"` // Modified timestamp of the parameter set. Modified time.Time `json:"modified" yaml:"modified"` // Parameters is a list of parameter specs. Parameters []valuesource.Strategy `json:"parameters" yaml:"parameters"` }
SourceParameterSet represents the file format of credential set documents from v0.38
type SourceResult ¶
type SourceResult struct { // Id of the result. ID string `json:"id"` // ClaimId associated with the claim that generated the result. ClaimID string `json:"claimId"` // Created timestamp of the result. Created time.Time `json:"created"` // Message communicates the outcome of the operation. Message string `json:"message,omitempty"` // Status of the operation, for example StatusSucceeded. Status string `json:"status"` // OutputMetadata generated by the operation, mapping from the output names to // metadata about the output. OutputMetadata cnab.OutputMetadata `json:"outputs,omitempty"` // Custom extension data applicable to a given runtime. Custom interface{} `json:"custom,omitempty"` }
SourceResult represents the file format of result documents from v0.38
type SourceSchema ¶
type SourceSchema struct { Claims schema.Version `json:"claims"` Credentials schema.Version `json:"credentials"` Parameters schema.Version `json:"parameters"` }
SourceSchema represents the file format of Porter's v0.38 schema document
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.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package crudstore supports reading data out of a legacy porter storage plugin
|
Package crudstore supports reading data out of a legacy porter storage plugin |
Package testhelpers contains helper functions for testing the pkg/storage/migrations package.
|
Package testhelpers contains helper functions for testing the pkg/storage/migrations package. |