Documentation ¶
Overview ¶
Package storage provides the functions that interacts with Spanner to fetch the data
Index ¶
- func InitializeDriver()
- type Storage
- func (s Storage) Close()
- func (s Storage) ExecuteSpannerQuery(ctx context.Context, table string, cols []string, isCountQuery bool, ...) ([]map[string]interface{}, error)
- func (s Storage) SpannerAdd(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, ...) (map[string]interface{}, error)
- func (s Storage) SpannerBatchDelete(ctx context.Context, table string, keys []map[string]interface{}) error
- func (s Storage) SpannerBatchGet(ctx context.Context, tableName string, pKeys, sKeys []interface{}, ...) ([]map[string]interface{}, error)
- func (s Storage) SpannerBatchPut(ctx context.Context, table string, m []map[string]interface{}) error
- func (s Storage) SpannerDel(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, ...) error
- func (s Storage) SpannerDelete(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, ...) error
- func (s Storage) SpannerGet(ctx context.Context, tableName string, pKeys, sKeys interface{}, ...) (map[string]interface{}, error)
- func (s Storage) SpannerPut(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, ...) (map[string]interface{}, error)
- func (s Storage) SpannerRemove(ctx context.Context, table string, m map[string]interface{}, eval *models.Eval, ...) error
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