services

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: 19 Imported by: 0

Documentation

Overview

Package services implements services for getting data from Spanner and streaming data into pubsub

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, tableName string, attrMap map[string]interface{}, condExpression string, m, expressionAttr map[string]interface{}, expr *models.UpdateExpressionCondition, oldRes map[string]interface{}) (map[string]interface{}, error)

Add checks the expression for converting the data

func BatchDelete

func BatchDelete(ctx context.Context, tableName string, keyMapArray []map[string]interface{}) error

BatchDelete service

func BatchGet

func BatchGet(ctx context.Context, tableName string, keyMapArray []map[string]interface{}) ([]map[string]interface{}, error)

BatchGet for batch operation for getting data

func BatchGetWithProjection

func BatchGetWithProjection(ctx context.Context, tableName string, keyMapArray []map[string]interface{}, projectionExpression string, expressionAttributeNames map[string]string) ([]map[string]interface{}, error)

BatchGetWithProjection from Spanner

func BatchPut

func BatchPut(ctx context.Context, tableName string, arrAttrMap []map[string]interface{}) error

BatchPut writes bulk records to Spanner

func Del

func Del(ctx context.Context, tableName string, attrMap map[string]interface{}, condExpression string, expressionAttr map[string]interface{}, expr *models.UpdateExpressionCondition) (map[string]interface{}, error)

Del checks the expression for saving the data

func Delete

func Delete(ctx context.Context, tableName string, primaryKeyMap map[string]interface{}, condExpression string, attrMap map[string]interface{}, expr *models.UpdateExpressionCondition) error

Delete service

func GetWithProjection

func GetWithProjection(ctx context.Context, tableName string, primaryKeyMap map[string]interface{}, projectionExpression string, expressionAttributeNames map[string]string) (map[string]interface{}, error)

GetWithProjection get table data with projection

func InitStream

func InitStream()

InitStream for initializing the stream

func IsPubSubAllowed

func IsPubSubAllowed(tableName string) (string, bool)

IsPubSubAllowed to check if PubSub is allowed or not for a table

func IsStreamEnabled

func IsStreamEnabled(tableName string) bool

IsStreamEnabled checks if a table is enabled for streaming or not

func MayIReadOrWrite

func MayIReadOrWrite(table string, IsMutation bool, operation string) bool

MayIReadOrWrite for checking the operation is allowed or not

func Put

func Put(ctx context.Context, tableName string, putObj map[string]interface{}, expr *models.UpdateExpressionCondition, conditionExp string, expressionAttr, oldRes map[string]interface{}) (map[string]interface{}, error)

Put writes an object to Spanner

func QueryAttributes

func QueryAttributes(ctx context.Context, query models.Query) (map[string]interface{}, string, error)

QueryAttributes from Spanner

func Remove

func Remove(ctx context.Context, tableName string, updateAttr models.UpdateAttr, actionValue string, expr *models.UpdateExpressionCondition, oldRes map[string]interface{}) (map[string]interface{}, error)

Remove for remove operation in update

func Scan

func Scan(ctx context.Context, scanData models.ScanMeta) (map[string]interface{}, error)

Scan service

func StartConfigManager

func StartConfigManager()

StartConfigManager starts config mangager for fetching the config manager data after certain time

func StreamDataToThirdParty

func StreamDataToThirdParty(oldImage, newImage map[string]interface{}, tableName string)

StreamDataToThirdParty for streaming data to any third party source

Types

This section is empty.

Jump to

Keyboard shortcuts

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