v1

package
v0.0.0-...-88d673b Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package v1 implements version-1 for DynamoDB-adapter APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchGetItem

func BatchGetItem(c *gin.Context)

BatchGetItem to get with projections @Description Request items in a batch with projections. @Summary Request items in a batch with projections. @ID batch-get-with-projection @Produce json @Success 200 {object} gin.H @Param requestBody body models.BatchGetWithProjectionMeta true "Please add request body of type models.BatchGetWithProjectionMeta" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /batchGetWithProjection/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func BatchWriteItem

func BatchWriteItem(c *gin.Context)

BatchWriteItem put & delete items in/from table @Description Batch Write Item for putting and deleting data in/from table @Summary Batch Write Items from table @ID batch-write-rows @Produce json @Success 200 {object} gin.H @Param requestBody body models.BatchWriteItem true "Please add request body of type models.BatchWriteItem" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /BatchWriteItem/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func ChangeColumnToSpanner

func ChangeColumnToSpanner(obj map[string]interface{}) map[string]interface{}

ChangeColumnToSpanner converts original column name to spanner supported column names

func ChangeColumnToSpannerExpressionName

func ChangeColumnToSpannerExpressionName(tableName string, expressNameMap map[string]string) map[string]string

ChangeColumnToSpannerExpressionName converts the Column Name into Spanner equivalent

func ChangeMaptoDynamoMap

func ChangeMaptoDynamoMap(in interface{}) (map[string]interface{}, error)

ChangeMaptoDynamoMap converts simple map into dynamo map

func ChangeQueryResponseColumn

func ChangeQueryResponseColumn(tableName string, obj map[string]interface{}) map[string]interface{}

ChangeQueryResponseColumn changes the response into dynamodb response for Query api

func ChangeResponseColumn

func ChangeResponseColumn(obj map[string]interface{}) map[string]interface{}

ChangeResponseColumn changes the spanner column name into original column if those exists

func ChangeResponseToOriginalColumns

func ChangeResponseToOriginalColumns(tableName string, obj map[string]interface{}) map[string]interface{}

ChangeResponseToOriginalColumns converts the map of spanner column into original column names

func ChangesArrayResponseToOriginalColumns

func ChangesArrayResponseToOriginalColumns(tableName string, obj []map[string]interface{}) []map[string]interface{}

ChangesArrayResponseToOriginalColumns changes the spanner column names to original column names

func ConvertDynamoArrayToMapArray

func ConvertDynamoArrayToMapArray(tableName string, dynamoMap []map[string]*dynamodb.AttributeValue) ([]map[string]interface{}, error)

ConvertDynamoArrayToMapArray this converts Dynamodb Object Array into Map Array

func ConvertDynamoToMap

func ConvertDynamoToMap(tableName string, dynamoMap map[string]*dynamodb.AttributeValue) (map[string]interface{}, error)

ConvertDynamoToMap converts the Dynamodb Object to Map

func ConvertFromMap

func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}, tableName string) (err error)

ConvertFromMap converts dynamodb AttributeValue into interface

func DeleteItem

func DeleteItem(c *gin.Context)

DeleteItem ... @Description Delete Item from table @Summary Delete Item from table @ID delete-row @Produce json @Success 200 {object} gin.H @Param requestBody body models.Delete true "Please add request body of type models.Delete" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /deleteItem/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func GetItemMeta

func GetItemMeta(c *gin.Context)

GetItemMeta to get with projections @Description Get a record with projections @Summary Get a record with projections @ID get-with-projection @Produce json @Success 200 {object} gin.H @Param requestBody body models.GetWithProjectionMeta true "Please add request body of type models.GetWithProjectionMeta" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /getWithProjection/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func InitDBAPI

func InitDBAPI(r *gin.Engine)

InitDBAPI - routes for apis

func PanicHandler

func PanicHandler(c *gin.Context)

PanicHandler is global handler for all type of panic

func QueryTable

func QueryTable(c *gin.Context)

QueryTable queries a table @Description Query a table @Summary Query a table @ID query-table @Produce json @Success 200 {object} gin.H @Param requestBody body models.Query true "Please add request body of type models.Query" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /query/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func ReplaceHashRangeExpr

func ReplaceHashRangeExpr(query models.Query) models.Query

ReplaceHashRangeExpr replaces the attribute names from Filter Expression and Range Expression

func RouteRequest

func RouteRequest(c *gin.Context)

RouteRequest - parse X-Amz-Target and call appropiate handler

func Scan

func Scan(c *gin.Context)

Scan record from table @Description Scan records from table @Summary Scan records from table @ID scan @Produce json @Success 200 {object} gin.H @Param requestBody body models.ScanMeta true "Please add request body of type models.ScanMeta" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /scan/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func Update

func Update(c *gin.Context)

Update updates a record in Spanner @Description updates a record in Spanner @Summary updates a record in Spanner @ID update @Produce json @Success 200 {object} gin.H @Param requestBody body models.UpdateAttr true "Please add request body of type models.UpdateAttr" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /update/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

func UpdateExpression

func UpdateExpression(ctx context.Context, updateAtrr models.UpdateAttr) (interface{}, error)

UpdateExpression performs an expression

func UpdateMeta

func UpdateMeta(c *gin.Context)

UpdateMeta Writes a record @Description Writes a record @Summary Writes record @ID put @Produce json @Success 200 {object} gin.H @Param requestBody body models.Meta true "Please add request body of type models.Meta" @Failure 500 {object} gin.H "{"errorMessage":"We had a problem with our server. Try again later.","errorCode":"E0001"}" @Router /put/ [post] @Failure 401 {object} gin.H "{"errorMessage":"API access not allowed","errorCode": "E0005"}"

Types

This section is empty.

Jump to

Keyboard shortcuts

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