dydb

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
	BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
	BatchExecuteStatement(ctx context.Context, params *dynamodb.BatchExecuteStatementInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchExecuteStatementOutput, error)
}

DB Default interface with methods that are available for both DB adn TX sessions.

type DynamoStore

type DynamoStore struct {
	*Queries
	// contains filtered or unexported fields
}

DynamoStore provides the Queries interface and a db instance.

func NewDynamoStore

func NewDynamoStore(db *dynamodb.Client) *DynamoStore

NewDynamoStore returns a SQLStore object which implements the Queires

type Queries

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

Queries is a struct with a db object that implements the DB interface. This means that db can either be a direct DB connection or a TX transaction.

func New

func New(db DB) *Queries

New returns a Queries object backed by a DB interface (either DB or TX)

func (*Queries) CheckUpdateManifestStatus

func (q *Queries) CheckUpdateManifestStatus(ctx context.Context, manifestFileTableName string, manifestTableName string,
	manifestId string, currentStatus string) (manifest.Status, error)

CheckUpdateManifestStatus checks current status of Manifest and updates if necessary.

func (*Queries) CreateManifest

func (q *Queries) CreateManifest(ctx context.Context, manifestTableName string, item dydb.ManifestTable) error

CreateManifest creates a new Manifest in DynamoDB

func (*Queries) GetFilesForPath

func (q *Queries) GetFilesForPath(ctx context.Context, tableName string, manifestId string, path string, filter string,
	limit int32, startKey map[string]types.AttributeValue) (*dynamodb.QueryOutput, error)

GetFilesForPath returns files in path for an upload with optional filter.

func (*Queries) GetFilesPaginated

func (q *Queries) GetFilesPaginated(ctx context.Context, tableName string, manifestId string, status sql.NullString,
	limit int32, startKey map[string]types.AttributeValue) ([]dydb.ManifestFileTable, map[string]types.AttributeValue, error)

GetFilesPaginated returns paginated list of files for a given manifestID and optional status.

func (*Queries) GetManifestById

func (q *Queries) GetManifestById(ctx context.Context, manifestTableName string, manifestId string) (*dydb.ManifestTable, error)

GetManifestById returns a Manifest item for a given manifest ID.

func (*Queries) GetManifestFile

func (q *Queries) GetManifestFile(ctx context.Context, tableName string, manifestId string, uploadId string) (*dydb.ManifestFileTable, error)

GetManifestFile returns an upload file from the ManifestFile Table.

func (*Queries) GetManifestsForDataset

func (q *Queries) GetManifestsForDataset(ctx context.Context, manifestTableName string,
	datasetNodeId string) ([]dydb.ManifestTable, error)

GetManifestsForDataset returns all manifests for a given dataset.

func (*Queries) SyncFiles

func (q *Queries) SyncFiles(manifestId string, items []manifestFile.FileDTO, forceStatus *manifestFile.Status, tableName string, fileNameTable string) (*manifest.AddFilesStats, error)

SyncFiles manages the workers and defines the go routines to add files to upload db.

func (*Queries) UpdateFileTableStatus

func (q *Queries) UpdateFileTableStatus(ctx context.Context, tableName string, manifestId string, uploadId string, status manifestFile.Status, msg string) error

UpdateFileTableStatus updates the status of the file in the file-table dydb

func (*Queries) UpdateManifestStatus added in v1.2.3

func (q *Queries) UpdateManifestStatus(ctx context.Context, tableName string, manifestId string, status manifest.Status) error

UpdateManifestStatus updates the status of the upload in dydb

Jump to

Keyboard shortcuts

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