storage

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

Documentation

Overview

Package storage provides the functions that interacts with Spanner to fetch the data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeDriver

func InitializeDriver()

InitializeDriver - this will Initialize databases object in global map

Types

type Storage

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

Storage object for intracting with storage package

func GetStorageInstance

func GetStorageInstance() *Storage

GetStorageInstance - return storage instance to call db functionalities

func (Storage) Close

func (s Storage) Close()

Close - This gracefully returns the session pool objects, when driver gets exit signal

func (Storage) ExecuteSpannerQuery

func (s Storage) ExecuteSpannerQuery(ctx context.Context, table string, cols []string, isCountQuery bool, stmt spanner.Statement) ([]map[string]interface{}, error)

ExecuteSpannerQuery - this will execute query on spanner database

func (Storage) SpannerAdd

func (s Storage) SpannerAdd(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, expr *models.UpdateExpressionCondition) (map[string]interface{}, error)

SpannerAdd - Spanner Add functionality like update attribute

func (Storage) SpannerBatchDelete

func (s Storage) SpannerBatchDelete(ctx context.Context, table string, keys []map[string]interface{}) error

SpannerBatchDelete - this delete the data in batch

func (Storage) SpannerBatchGet

func (s Storage) SpannerBatchGet(ctx context.Context, tableName string, pKeys, sKeys []interface{}, projectionCols []string) ([]map[string]interface{}, error)

SpannerBatchGet - fetch all rows

func (Storage) SpannerBatchPut

func (s Storage) SpannerBatchPut(ctx context.Context, table string, m []map[string]interface{}) error

SpannerBatchPut - this insert or update data in batch

func (Storage) SpannerDel

func (s Storage) SpannerDel(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, expr *models.UpdateExpressionCondition) error

SpannerDel for delete operation on Spanner

func (Storage) SpannerDelete

func (s Storage) SpannerDelete(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, expr *models.UpdateExpressionCondition) error

SpannerDelete - this will delete the data

func (Storage) SpannerGet

func (s Storage) SpannerGet(ctx context.Context, tableName string, pKeys, sKeys interface{}, projectionCols []string) (map[string]interface{}, error)

SpannerGet - get with spanner

func (Storage) SpannerPut

func (s Storage) SpannerPut(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, expr *models.UpdateExpressionCondition) (map[string]interface{}, error)

SpannerPut - Spanner put insert a single object

func (Storage) SpannerRemove

func (s Storage) SpannerRemove(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, expr *models.UpdateExpressionCondition, colsToRemove []string) error

SpannerRemove - Spanner Remove functionality like update attribute

Jump to

Keyboard shortcuts

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