Documentation ¶
Overview ¶
Package v1 implements version-1 for DynamoDB-adapter APIs
Index ¶
- func BatchGetItem(c *gin.Context)
- func BatchWriteItem(c *gin.Context)
- func ChangeColumnToSpanner(obj map[string]interface{}) map[string]interface{}
- func ChangeColumnToSpannerExpressionName(tableName string, expressNameMap map[string]string) map[string]string
- func ChangeMaptoDynamoMap(in interface{}) (map[string]interface{}, error)
- func ChangeQueryResponseColumn(tableName string, obj map[string]interface{}) map[string]interface{}
- func ChangeResponseColumn(obj map[string]interface{}) map[string]interface{}
- func ChangeResponseToOriginalColumns(tableName string, obj map[string]interface{}) map[string]interface{}
- func ChangesArrayResponseToOriginalColumns(tableName string, obj []map[string]interface{}) []map[string]interface{}
- func ConvertDynamoArrayToMapArray(tableName string, dynamoMap []map[string]*dynamodb.AttributeValue) ([]map[string]interface{}, error)
- func ConvertDynamoToMap(tableName string, dynamoMap map[string]*dynamodb.AttributeValue) (map[string]interface{}, error)
- func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}, tableName string) (err error)
- func DeleteItem(c *gin.Context)
- func GetItemMeta(c *gin.Context)
- func InitDBAPI(r *gin.Engine)
- func PanicHandler(c *gin.Context)
- func QueryTable(c *gin.Context)
- func ReplaceHashRangeExpr(query models.Query) models.Query
- func RouteRequest(c *gin.Context)
- func Scan(c *gin.Context)
- func Update(c *gin.Context)
- func UpdateExpression(ctx context.Context, updateAtrr models.UpdateAttr) (interface{}, error)
- func UpdateMeta(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchGetItem ¶
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 ¶
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 ¶
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 ¶
ChangeMaptoDynamoMap converts simple map into dynamo map
func ChangeQueryResponseColumn ¶
ChangeQueryResponseColumn changes the response into dynamodb response for Query api
func ChangeResponseColumn ¶
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 ¶
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 ¶
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 PanicHandler ¶
PanicHandler is global handler for all type of panic
func QueryTable ¶
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 ¶
ReplaceHashRangeExpr replaces the attribute names from Filter Expression and Range Expression
func RouteRequest ¶
RouteRequest - parse X-Amz-Target and call appropiate handler
func Scan ¶
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 ¶
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 ¶
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.