db

package
v0.0.0-...-c92edef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeContext

func InitializeContext(ctx context.Context) context.Context

Types

type ContextKey

type ContextKey string

ContextKey defines a type to store the integration DB session in context.Context.

type Logger

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

Logger logs the db operations in a configurable file.

func GetLogger

func GetLogger() *Logger

GetLogger returns the logger for db operations. If the logger is not created yet, it creates a new instance of Logger.

func NewLogger

func NewLogger(logsPath string) (*Logger, error)

NewLogger creates an instance of the logger. It configures the file path where the db operations are logged.

func (Logger) LogMessage

func (l Logger) LogMessage(message string)

Log a db message

type Session

type Session struct {
	AwsSession     *aws_s.Session
	DynamoDBClient *dynamodb.DynamoDB
	TestTableName  string
}

func GetSession

func GetSession(ctx context.Context) *Session

GetSession returns the integration DB session stored in context. Note that the context should be previously initialized with InitializeContext function.

func (*Session) CreateDynamoDBTable

func (s *Session) CreateDynamoDBTable(tableName, indexName string) error

func (*Session) DeleteDynamoDBTable

func (s *Session) DeleteDynamoDBTable(tableName string) error

func (*Session) ListDynamoDBTables

func (s *Session) ListDynamoDBTables() error

func (*Session) SetAwsDynamoClient

func (s *Session) SetAwsDynamoClient()

type Steps

type Steps struct {
}

func (Steps) InitializeSteps

func (s Steps) InitializeSteps(
	ctx context.Context,
	scenCtx *godog.ScenarioContext,
) context.Context

Jump to

Keyboard shortcuts

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