s3repository

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

View Source
const DATA_SUFFIX = ".data"
View Source
const MD_SUFFIX = ".md"

* Protected Entities are stored in the S3 repo as 1-3 files. The peinfo file contains the Protected Entity JSON, * the md file contains the Protected Entity metadata, if present and the data file contains the Protected Entity data, * if present. The basic structure of the repository is * <bucket>/<user specified prefix>/<type>/{peinfo, md, data}/<peid>[, .md, .data] * The PEID must have a snapshot component * For example, an IVD would be represented as three S3 objects: * /astrolabe-repo/ivd/peinfo/ivd:e1c3cb20-db88-4c1c-9f02-5f5347e435d5:67469e1c-50a8-4f63-9a6a-ad8a2265197c * /astrolabe-repo/ivd/md/ivd:e1c3cb20-db88-4c1c-9f02-5f5347e435d5:67469e1c-50a8-4f63-9a6a-ad8a2265197c.md * /astrolabe-repo/ivd/data/ivd:e1c3cb20-db88-4c1c-9f02-5f5347e435d5:67469e1c-50a8-4f63-9a6a-ad8a2265197c.data * * The combined stream is not stored in S3 but could be synthesized on demand (figure out how this would actually work)

View Source
const MaxBufferSize = 10 * 1024 * 1024 // Let's not get too crazy with buffers
View Source
const MaxParts = 10000 // Maximum number of parts we will use
View Source
const MinMultiPartSize = 5 * 1024 * 1024
View Source
const SegmentSizeLimit = MaxParts * MaxBufferSize

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtectedEntity

type ProtectedEntity struct {
	// contains filtered or unexported fields
}

func NewProtectedEntityFromJSONBuf

func NewProtectedEntityFromJSONBuf(rpetm *ProtectedEntityTypeManager, buf []byte) (pe ProtectedEntity, err error)

func NewProtectedEntityFromJSONReader

func NewProtectedEntityFromJSONReader(rpetm *ProtectedEntityTypeManager, reader io.Reader) (pe ProtectedEntity, err error)

func (ProtectedEntity) DeleteSnapshot

func (this ProtectedEntity) DeleteSnapshot(ctx context.Context,
	snapshotToDelete astrolabe.ProtectedEntitySnapshotID,
	params map[string]map[string]interface{}) (bool, error)

func (ProtectedEntity) GetCombinedInfo

func (ProtectedEntity) GetComponents

func (ProtectedEntity) GetDataReader

func (this ProtectedEntity) GetDataReader(ctx context.Context) (io.ReadCloser, error)

func (ProtectedEntity) GetID

func (ProtectedEntity) GetInfo

func (ProtectedEntity) GetInfoForSnapshot

func (ProtectedEntity) GetMetadataReader

func (this ProtectedEntity) GetMetadataReader(ctx context.Context) (io.ReadCloser, error)

func (ProtectedEntity) ListSnapshots

func (ProtectedEntity) Overwrite added in v0.2.0

func (this ProtectedEntity) Overwrite(ctx context.Context, sourcePE astrolabe.ProtectedEntity, params map[string]map[string]interface{},
	overwriteComponents bool) error

func (ProtectedEntity) Snapshot

func (ProtectedEntity) Snapshot(ctx context.Context, params map[string]map[string]interface{}) (astrolabe.ProtectedEntitySnapshotID, error)

type ProtectedEntityTypeManager

type ProtectedEntityTypeManager struct {
	// contains filtered or unexported fields
}

* ProtectedEntityTypeManager for an S3 repository acts as a passive, generic Protected Entity Type Manager * Protected Entities served by the type manager do not change and are always read-only.

func NewS3RepositoryProtectedEntityTypeManager

func NewS3RepositoryProtectedEntityTypeManager(typeName string, session session.Session, bucket string,
	prefix string, logger logrus.FieldLogger) (*ProtectedEntityTypeManager, error)

func (*ProtectedEntityTypeManager) Copy

func (*ProtectedEntityTypeManager) CopyFromInfo

func (this *ProtectedEntityTypeManager) CopyFromInfo(ctx context.Context, sourcePEInfo astrolabe.ProtectedEntityInfo, params map[string]map[string]interface{},
	options astrolabe.CopyCreateOptions) (astrolabe.ProtectedEntity, error)

func (*ProtectedEntityTypeManager) GetProtectedEntities

func (this *ProtectedEntityTypeManager) GetProtectedEntities(ctx context.Context) ([]astrolabe.ProtectedEntityID, error)

func (*ProtectedEntityTypeManager) GetProtectedEntitiesByIDPrefix

func (this *ProtectedEntityTypeManager) GetProtectedEntitiesByIDPrefix(ctx context.Context, idPrefix string) ([]astrolabe.ProtectedEntityID, error)

func (*ProtectedEntityTypeManager) GetProtectedEntity

func (*ProtectedEntityTypeManager) GetTypeName

func (this *ProtectedEntityTypeManager) GetTypeName() string

type RepositoryProtectedEntityManager

type RepositoryProtectedEntityManager struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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