storage

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package storage is an internal Porter package that implements the crud store via plugins.

Index

Constants

View Source
const (
	ParameterSetDefaultSchemaVersion schema.Version = "1.0.0-DRAFT+TODO"
	ParameterSetCNABSpecVersion      string         = "cnab-parametersets-" + string(ParameterSetDefaultSchemaVersion)
)

TODO (carolynvs): Replace with cnab-go's const when this moves to cnab-go

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	*config.Config

	// BackingStore is the underlying storage managed by this instance. It
	// shouldn't be used for typed read/access the data, for that use the ClaimsProvider
	// or CredentialsProvider which works with the Storage.Manager.
	*crud.BackingStore
	// 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, datastore crud.Store) *Manager

NewManager creates a storage manager for a backing datastore.

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Connect

func (m *Manager) Connect() error

func (*Manager) Count

func (m *Manager) Count(itemType string, group string) (int, error)

func (*Manager) Delete

func (m *Manager) Delete(itemType string, name string) error

func (*Manager) GetDataStore

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

func (*Manager) HandleConnect

func (m *Manager) HandleConnect() (func() error, error)

func (*Manager) List

func (m *Manager) List(itemType string, group string) ([]string, 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) Read

func (m *Manager) Read(itemType string, name string) ([]byte, error)

func (*Manager) ReadAll

func (m *Manager) ReadAll(itemType string, group string) ([][]byte, error)

func (*Manager) Save

func (m *Manager) Save(itemType string, group string, name string, data []byte) 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 parameters storage system requires a migration.

type Schema

type Schema struct {
	Claims      schema.Version `json:"claims"`
	Credentials schema.Version `json:"credentials"`
	Parameters  schema.Version `json:"parameters"`
}

type StorageProvider

type StorageProvider interface {
	// Migrate executes a migration on any/all of Porter's storage sub-systems.
	Migrate() (string, error)
}

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

Directories

Path Synopsis
Package crudstore defines the crudstore plugin interface shared between Porter and its plugin.
Package crudstore defines the crudstore plugin interface shared between Porter and its plugin.
Package filesystem implements the crudstore plugin interface, storing data on the local filesystem.
Package filesystem implements the crudstore plugin interface, storing data on the local filesystem.
Package pluginstore is an internal Porter package that implements the crud.Store interface via plugins.
Package pluginstore is an internal Porter package that implements the crud.Store interface via plugins.

Jump to

Keyboard shortcuts

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