Documentation
¶
Overview ¶
Package models implements all the structs required by application
Index ¶
- Variables
- type BatchDeleteItem
- type BatchGetMeta
- type BatchGetWithProjectionMeta
- type BatchMeta
- type BatchMetaUpdate
- type BatchPutItem
- type BatchWriteItem
- type BatchWriteItemResponse
- type BatchWriteSubItems
- type BulkDelete
- type ConditionCheckItem
- type ConditionCheckRequest
- type Config
- type ConfigControllerModel
- type ConsumedCapacity
- type Delete
- type DeleteItem
- type DeleteItemRequest
- type Eval
- type ExecuteStatement
- type ExecuteStatementQuery
- type GetItemMeta
- type GetItemRequest
- type GetKeyMeta
- type ItemCollectionMetrics
- type KeyCondition
- type Meta
- type Operation
- type OtelConfig
- type Proxy
- type PutItem
- type PutItemRequest
- type Query
- type ResponseItem
- type ScanMeta
- type Session
- type SetKeyMeta
- type SpannerConfig
- type StreamDataModel
- type TableConfig
- type TransactGetItem
- type TransactGetItemResponse
- type TransactGetItemsRequest
- type TransactGetItemsResponse
- type TransactWriteItem
- type TransactWriteItemOutput
- type TransactWriteItemsOutput
- type TransactWriteItemsRequest
- type TransactWriteItemsResponse
- type UpdateAttr
- type UpdateExpressionCondition
- type UpdateItem
- type UpdateItemRequest
Constants ¶
This section is empty.
Variables ¶
var ColumnToOriginalCol map[string]string
ColumnToOriginalCol for Original column map
var DbConfigMap map[string]TableConfig
var OriginalColResponse map[string]string
OriginalColResponse for Original Column Response
var SpannerTableMap = make(map[string]string)
SpannerTableMap for spanner column map
var TableColChangeMap map[string]struct{}
TableColChangeMap for changed columns map
var TableColumnMap map[string][]string
TableColumnMap - this contains the list of columns for the tables
var TableDDL map[string]map[string]string
TableDDL - this contains the DDL
var TableSpannerDDL map[string]map[string]string
TableSpannerDDL - this contains the DDL with spanner data types
Functions ¶
This section is empty.
Types ¶
type BatchDeleteItem ¶
type BatchDeleteItem struct {
Key map[string]*dynamodb.AttributeValue `json:"Key"`
}
BatchDeleteItem is for BatchWriteSubItems
type BatchGetMeta ¶
type BatchGetMeta struct {
RequestItems map[string]BatchGetWithProjectionMeta `json:"RequestItems"`
}
BatchGetMeta struct
type BatchGetWithProjectionMeta ¶
type BatchGetWithProjectionMeta struct {
TableName string `json:"TableName"`
KeyArray []map[string]interface{} `json:"KeyArray"`
ProjectionExpression string `json:"ProjectionExpression"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
Keys []map[string]*dynamodb.AttributeValue `json:"Keys"`
}
BatchGetWithProjectionMeta struct
type BatchMeta ¶
type BatchMeta struct {
TableName string `json:"TableName"`
KeyArray []map[string]interface{} `json:"KeyArray"`
DynamoObject []map[string]*dynamodb.AttributeValue `json:"DynamoObject"`
}
BatchMeta struct
type BatchMetaUpdate ¶
type BatchMetaUpdate struct {
TableName string `json:"TableName"`
ArrAttrMap []map[string]interface{} `json:"ArrAttrMap"`
DynamoObject []map[string]*dynamodb.AttributeValue `json:"DynamoObject"`
}
BatchMetaUpdate struct
type BatchPutItem ¶
type BatchPutItem struct {
Item map[string]*dynamodb.AttributeValue `json:"Item"`
}
BatchPutItem is for BatchWriteSubItems
type BatchWriteItem ¶
type BatchWriteItem struct {
RequestItems map[string][]BatchWriteSubItems `json:"RequestItems"`
}
BatchWriteItem for Batch Operation
type BatchWriteItemResponse ¶
type BatchWriteItemResponse struct {
UnprocessedItems map[string][]BatchWriteSubItems `json:"UnprocessedItems"`
}
BatchWriteItemResponse for Batch Operation
type BatchWriteSubItems ¶
type BatchWriteSubItems struct {
DelReq BatchDeleteItem `json:"DeleteRequest"`
PutReq BatchPutItem `json:"PutRequest"`
}
BatchWriteSubItems is for BatchWriteItem
type BulkDelete ¶
type BulkDelete struct {
TableName string `json:"TableName"`
PrimaryKeyMapArray []map[string]interface{} `json:"KeyArray"`
DynamoObject []map[string]*dynamodb.AttributeValue `json:"DynamoObject"`
}
BulkDelete struct
type ConditionCheckItem ¶
type ConditionCheckItem struct {
Key map[string]interface{} `json:"Key"`
}
type ConditionCheckRequest ¶
type ConditionCheckRequest struct {
TableName string `json:"TableName"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
PrimaryKeyMap map[string]interface{} `json:"PrimaryKeyMap"`
ReturnValues string `json:"ReturnValuesOnConditionCheckFailure"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
}
type Config ¶
type Config struct {
Spanner SpannerConfig `mapstructure:"spanner"`
Otel *OtelConfig `mapstructure:"otel"`
UserAgent string
GinMode string `mapstructure:"gin_mode"`
LogLevel string `mapstructure:"log_level"`
}
var GlobalConfig *Config
type ConfigControllerModel ¶
type ConfigControllerModel struct {
Mux sync.RWMutex
UniqueVal string
CornTime string
StopConfigManager bool
ReadMap map[string]struct{}
WriteMap map[string]struct{}
StreamEnable map[string]struct{}
}
ConfigControllerModel for Config controller
var ConfigController *ConfigControllerModel
ConfigController object for ConfigControllerModel
type ConsumedCapacity ¶
type Delete ¶
type Delete struct {
TableName string `json:"TableName"`
PrimaryKeyMap map[string]interface{} `json:"PrimaryKeyMap"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
}
Delete struct
type DeleteItem ¶
type DeleteItem struct {
Key map[string]interface{} `json:"Key"`
}
type DeleteItemRequest ¶
type DeleteItemRequest struct {
TableName string `json:"TableName"`
PrimaryKeyMap map[string]interface{} `json:"PrimaryKeyMap"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
ReturnValues string `json:"ReturnValuesOnConditionCheckFailure"`
}
DeleteItemRequest represents the structure of a Delete request.
type Eval ¶
type Eval struct {
Cond *vm.Program
Attributes []string
Cols []string
Tokens []string
ValueMap map[string]interface{}
}
Eval for Evaluation expression
type ExecuteStatement ¶
type ExecuteStatement struct {
Limit int64 `json:"Limit"`
NextToken int64 `json:"NextToken"`
Parameters []*dynamodb.AttributeValue `json:"Parameters"`
ReturnValues string `json:"ReturnValues"`
Statement string `json:"Statement"`
TableName string `json:"TableName"`
AttrParams []interface{} `json:"AttrParams"`
}
type ExecuteStatementQuery ¶
type GetItemMeta ¶
type GetItemMeta struct {
TableName string `json:"TableName"`
PrimaryKeyMap map[string]interface{} `json:"PrimaryKeyMap"`
ProjectionExpression string `json:"ProjectionExpression"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
}
GetItemMeta struct
type GetItemRequest ¶
type GetItemRequest struct {
TableName string `json:"TableName"`
Keys map[string]*dynamodb.AttributeValue `json:"Key"`
KeyArray []map[string]interface{} `json:"KeyArray"`
ProjectionExpression string `json:"ProjectionExpression,omitempty"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames,omitempty"`
}
GetItemRequest represents the structure of a Get request.
type GetKeyMeta ¶
type GetKeyMeta struct {
Key string `json:"Key"`
Type string `json:"Type"`
DynamoObject map[string]*dynamodb.AttributeValue `json:"DynamoObject"`
}
GetKeyMeta struct
type ItemCollectionMetrics ¶
type ItemCollectionMetrics struct {
ItemCollectionSizeEstimate int64 `json:"ItemCollectionSizeEstimate"`
}
ItemCollectionMetrics represents the item collection metrics. (Add more fields as needed)
type KeyCondition ¶
type KeyCondition struct {
AttributeValueList []*dynamodb.AttributeValue `json:"AttributeValueList"`
ComparisonOperator string `json:"ComparisonOperator"`
}
type Meta ¶
type Meta struct {
TableName string `json:"TableName"`
AttrMap map[string]interface{} `json:"AttrMap"`
ReturnValues string `json:"ReturnValues"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
Item map[string]*dynamodb.AttributeValue `json:"Item"`
}
Meta struct
type Operation ¶
type Operation struct {
MaxCommitDelay uint64 `mapstructure:"maxCommitDelay"`
ReplayProtection bool `mapstructure:"replayProtection"`
}
Spanner read/write operation settings.
type OtelConfig ¶
type OtelConfig struct {
Enabled bool `mapstructure:"enabled"`
EnabledClientSideMetrics bool `mapstructure:"enabledClientSideMetrics"`
ServiceName string `mapstructure:"serviceName"`
HealthCheck struct {
Enabled bool `mapstructure:"enabled"`
Endpoint string `mapstructure:"endpoint"`
} `mapstructure:"healthcheck"`
Metrics struct {
Enabled bool `mapstructure:"enabled"`
Endpoint string `mapstructure:"endpoint"`
} `mapstructure:"metrics"`
Traces struct {
Enabled bool `mapstructure:"enabled"`
Endpoint string `mapstructure:"endpoint"`
SamplingRatio float64 `mapstructure:"samplingRatio"`
} `mapstructure:"traces"`
}
OtelConfig defines the structure of the mapstructure configuration
type Proxy ¶
type Proxy struct {
Context context.Context
OtelInst *otelgo.OpenTelemetry // Exported field (starts with uppercase)
OtelShutdown func(context.Context) error
}
var GlobalProxy *Proxy
type PutItemRequest ¶
type PutItemRequest struct {
TableName string `json:"TableName"`
AttrMap map[string]interface{} `json:"AttrMap"`
ReturnValues string `json:"ReturnValuesOnConditionCheckFailure"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
Item map[string]*dynamodb.AttributeValue `json:"Item"`
}
PutItemRequest represents the structure of a Put request.
type Query ¶
type Query struct {
TableName string `json:"TableName"`
IndexName string `json:"IndexName"`
OnlyCount bool `json:"OnlyCount"`
Limit int64 `json:"Limit"`
SortAscending bool `json:"ScanIndexForward"`
StartFrom map[string]interface{} `json:"StartFrom"`
ProjectionExpression string `json:"ProjectionExpression"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
FilterExp string `json:"FilterExpression"`
RangeExp string `json:"KeyConditionExpression"`
KeyConditions map[string]KeyCondition `json:"KeyConditions"`
RangeValMap map[string]interface{} `json:"RangeValMap"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
ExclusiveStartKey map[string]*dynamodb.AttributeValue `json:"ExclusiveStartKey"`
Select string `json:"Select"`
}
Query struct
type ResponseItem ¶
type ResponseItem struct {
TableName interface{} `json:"TableName"`
Item map[string]interface{} `json:"Item"`
}
type ScanMeta ¶
type ScanMeta struct {
TableName string `json:"TableName"`
IndexName string `json:"IndexName"`
OnlyCount bool `json:"OnlyCount"`
Select string `json:"Select"`
Limit int64 `json:"Limit"`
StartFrom map[string]interface{} `json:"StartFrom"`
ExclusiveStartKey map[string]*dynamodb.AttributeValue `json:"ExclusiveStartKey"`
FilterExpression string `json:"FilterExpression"`
ProjectionExpression string `json:"ProjectionExpression"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
ExpressionAttributeMap map[string]interface{} `json:"ExpressionAttributeMap"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
}
ScanMeta for Scan request
type SetKeyMeta ¶
type SetKeyMeta struct {
Key string `json:"Key"`
Type string `json:"Type"`
Value string `json:"Value"`
DynamoObject map[string]*dynamodb.AttributeValue `json:"DynamoObject"`
}
SetKeyMeta struct
type SpannerConfig ¶
type SpannerConfig struct {
ProjectID string `mapstructure:"project_id"`
InstanceID string `mapstructure:"instance_id"`
DatabaseName string `mapstructure:"database_name"`
QueryLimit int64 `mapstructure:"query_limit"`
DynamoQueryLimit int32 `mapstructure:"dynamo_query_limit"`
Session Session `mapstructure:"Session"`
}
type StreamDataModel ¶
type StreamDataModel struct {
OldImage map[string]interface{} `json:"OldImage"`
NewImage map[string]interface{} `json:"NewImage"`
Keys map[string]interface{} `json:"Keys"`
Timestamp int64 `json:"Timestamp"`
Table string `json:"TableName"`
EventName string `json:"EventName"`
SequenceNumber int64 `json:"SequenceNumber"`
EventID string `json:"EventId"`
EventSourceArn string `json:"EventSourceArn"`
}
StreamDataModel for streaming data
type TableConfig ¶
type TableConfig struct {
PartitionKey string `json:"PartitionKey,omitempty"`
SortKey string `json:"SortKey,omitempty"`
Indices map[string]TableConfig `json:"Indices,omitempty"`
GCSSourcePath string `json:"GcsSourcePath,omitempty"`
DDBIndexName string `json:"DdbIndexName,omitempty"`
SpannerIndexName string `json:"SpannerIndexName,omitempty"`
IsPadded bool `json:"IsPadded,omitempty"`
IsComplement bool `json:"IsComplement,omitempty"`
TableSource string `json:"TableSource,omitempty"`
ActualTable string `json:"ActualTable,omitempty"`
}
TableConfig for Configuration table
type TransactGetItem ¶
type TransactGetItem struct {
Get GetItemRequest `json:"Get"`
}
TransactGetItem represents a single Get operation inside TransactGetItems.
type TransactGetItemResponse ¶
type TransactGetItemsRequest ¶
type TransactGetItemsRequest struct {
TransactItems []TransactGetItem `json:"TransactItems"`
ReturnConsumedCapacity string `json:"ReturnConsumedCapacity,omitempty"`
}
TransactGetItemsRequest represents the input structure for TransactGetItems API.
type TransactGetItemsResponse ¶
type TransactGetItemsResponse struct {
Responses []TransactGetItemResponse `json:"Responses"`
}
TransactGetItemsResponse represents the overall response structure for multiple TransactGetItems.
type TransactWriteItem ¶
type TransactWriteItem struct {
Put PutItemRequest `json:"Put,omitempty"`
Update UpdateAttr `json:"Update,omitempty"`
Delete DeleteItemRequest `json:"Delete,omitempty"`
ConditionCheck ConditionCheckRequest `json:"ConditionCheck,omitempty"`
}
TransactWriteItem represents a single Put, Update, or Delete operation inside TransactWriteItems.
type TransactWriteItemOutput ¶
type TransactWriteItemOutput struct {
Put *PutItem `json:"Put,omitempty"`
Update *UpdateItem `json:"Update,omitempty"`
Delete *DeleteItem `json:"Delete,omitempty"`
ConditionCheck *struct{} `json:"ConditionCheck,omitempty"`
}
type TransactWriteItemsOutput ¶
type TransactWriteItemsOutput struct {
Item []map[string]interface{} `json:"Item"`
}
type TransactWriteItemsRequest ¶
type TransactWriteItemsRequest struct {
TransactItems []TransactWriteItem `json:"TransactItems"`
ReturnConsumedCapacity string `json:"ReturnConsumedCapacity,omitempty"`
ReturnItemCollectionMetrics string `json:"ReturnItemCollectionMetrics,omitempty"` // Added for consistency with DynamoDB
}
TransactWriteItemsRequest represents the input structure for TransactWriteItems API.
type TransactWriteItemsResponse ¶
type TransactWriteItemsResponse struct {
ConsumedCapacity ConsumedCapacity `json:"ConsumedCapacity,omitempty"` // Added for consistency
ItemCollectionMetrics map[string]ItemCollectionMetrics `json:"ItemCollectionMetrics,omitempty"` // Added for consistency
}
type UpdateAttr ¶
type UpdateAttr struct {
TableName string `json:"TableName"`
PrimaryKeyMap map[string]interface{} `json:"PrimaryKeyMap"`
ReturnValues string `json:"ReturnValues"`
UpdateExpression string `json:"UpdateExpression"`
ConditionExpression string `json:"ConditionExpression"`
ExpressionAttributeMap map[string]interface{} `json:"AttrVals"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues"`
}
UpdateAttr struct
type UpdateExpressionCondition ¶
type UpdateExpressionCondition struct {
Field []string
Value []string
Condition []string
ActionVal string
AddValues map[string]float64
}
UpdateExpressionCondition for Update Condition
type UpdateItem ¶
type UpdateItem struct {
Key map[string]interface{} `json:"Key"`
}
type UpdateItemRequest ¶
type UpdateItemRequest struct {
TableName string `json:"TableName"`
Key map[string]*dynamodb.AttributeValue `json:"Key"`
KeyArray map[string]interface{} `json:"KeyArray"`
UpdateExpression string `json:"UpdateExpression"`
ExpressionAttributeNames map[string]string `json:"ExpressionAttributeNames,omitempty"`
ExpressionAttributeValues map[string]*dynamodb.AttributeValue `json:"ExpressionAttributeValues,omitempty"`
ReturnValues string `json:"ReturnValuesOnConditionCheckFailure"`
}
UpdateItemRequest represents the structure of an Update request.