cosmosdb

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATABASE_NAME        = "gatewayDB"
	USERS_CONTAINER_NAME = "users"
)

Constants for the CosmosDB database and container names

Variables

This section is empty.

Functions

This section is empty.

Types

type CosmosDB

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

CosmosDB struct represents the CosmosDB storage implementation

func NewCosmosDB

func NewCosmosDB(connectionString string, encryptionKey []byte) (*CosmosDB, error)

func (*CosmosDB) AddAccount

func (c *CosmosDB) AddAccount(userID []byte, accountAddress []byte, signature []byte, signatureType viewingkey.SignatureType) error

func (*CosmosDB) AddUser

func (c *CosmosDB) AddUser(userID []byte, privateKey []byte) error

func (*CosmosDB) DeleteUser

func (c *CosmosDB) DeleteUser(userID []byte) error

func (*CosmosDB) GetUser

func (c *CosmosDB) GetUser(userID []byte) (*common.GWUser, error)

type EncryptedDocument

type EncryptedDocument struct {
	ID   string `json:"id"`
	Data []byte `json:"data"`
}

EncryptedDocument struct is used to store encrypted user data in CosmosDB We use this structure to add an extra layer of security by encrypting the actual user data The 'ID' field is used as the document ID and partition key in CosmosDB The 'Data' field contains the base64-encoded encrypted user data

Jump to

Keyboard shortcuts

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