appdynamodb

package
v1.5.39 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

README

DynamoDB Schema

Each adapter extends core DB schema with extra supported type to consolidate in a single table all elements of the application.

For readability purpose, the big picture is documented in this file.

Schema

Entries
PK SK Description Module
{OWNER}#ALBUM ALBUM#{FOLDER_NAME} Album metadata catalogdynamo
{OWNER}#MEDIA#{id} #METADATA Media metadata catalogdynamo
{OWNER}#MEDIA#{id} LOCATION# Media location if the archive archivedynamo
USER#{EMAIL} SCOPE#{TYPE}#{OWNER}#{RESOURCE ID} Scopes allowed for a user (ownership, shared, ...) aclscopedynamodb
USER#{EMAIL} IDENTITY# Details about the user (name, picture, ...) aclidentitydynamodb
REFRESH#{TOKEN} #REFRESH_SPEC Refresh token aclrefreshdynamodb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTableIfNecessary

func CreateTableIfNecessary(ctx context.Context, table string, client *dynamodb.Client, localDynamodb bool) error

CreateTableIfNecessary creates the table if it doesn't exist ; or update it.

func MediaPrimaryKeyPK

func MediaPrimaryKeyPK(owner string, id string) string

MediaPrimaryKeyPK is the PK of a media, used to regroup media related information together

func UserPk

func UserPk(userEmail string) string

UserPk is the PK of a user, used to regroup user related information together

Types

type TablePk

type TablePk struct {
	PK string // PK is the Partition key ; see what's used depending on object types
	SK string // SK is the Sort key ; see what's used depending on object types
}

TablePk are the primary and sort keys of the table

Jump to

Keyboard shortcuts

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