Documentation ¶
Index ¶
- type DB
- type DynamoStore
- type Queries
- func (q *Queries) CheckUpdateManifestStatus(ctx context.Context, manifestFileTableName string, manifestTableName string, ...) (manifest.Status, error)
- func (q *Queries) CreateManifest(ctx context.Context, manifestTableName string, item dydb.ManifestTable) error
- func (q *Queries) GetFilesForPath(ctx context.Context, tableName string, manifestId string, path string, ...) (*dynamodb.QueryOutput, error)
- func (q *Queries) GetFilesPaginated(ctx context.Context, tableName string, manifestId string, ...) ([]dydb.ManifestFileTable, map[string]types.AttributeValue, error)
- func (q *Queries) GetManifestById(ctx context.Context, manifestTableName string, manifestId string) (*dydb.ManifestTable, error)
- func (q *Queries) GetManifestFile(ctx context.Context, tableName string, manifestId string, uploadId string) (*dydb.ManifestFileTable, error)
- func (q *Queries) GetManifestsForDataset(ctx context.Context, manifestTableName string, datasetNodeId string) ([]dydb.ManifestTable, error)
- func (q *Queries) SyncFiles(manifestId string, items []manifestFile.FileDTO, ...) (*manifest.AddFilesStats, error)
- func (q *Queries) UpdateFileTableStatus(ctx context.Context, tableName string, manifestId string, uploadId string, ...) error
- func (q *Queries) UpdateManifestStatus(ctx context.Context, tableName string, manifestId string, ...) error
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 (*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.