core

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectENV added in v1.2.0

func ConnectENV() (*sql.DB, error)

ConnectENV returns a DB instance. Used for testing, it requires the following environment variables to be set - POSTGRES_HOST - POSTGRES_PORT (will default to 5432 if missing) - POSTGRES_USER - POSTGRES_PASSWORD - PENNSIEVE_DB - POSTGRES_SSL_MODE (should be set to "disable" if the server is not https, left blank if it is)

func ConnectENVWithOrg added in v1.2.0

func ConnectENVWithOrg(orgId int) (*sql.DB, error)

func ConnectRDS

func ConnectRDS() (*sql.DB, error)

ConnectRDS returns a DB instance. The Lambda function leverages IAM roles to gain access to the DB Proxy. The function does NOT set the search_path to the organization schema. Requires following LAMBDA ENV VARIABLES:

  • RDS_PROXY_ENDPOINT
  • REGION
  • ENV

func ConnectRDSWithOrg

func ConnectRDSWithOrg(orgId int) (*sql.DB, error)

ConnectRDSWithOrg returns a DB instance. The Lambda function leverages IAM roles to gain access to the DB Proxy. The function DOES set the search_path to the organization schema.

Types

type DynamoDBAPI

type DynamoDBAPI interface {
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
	BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
	BatchExecuteStatement(ctx context.Context, params *dynamodb.BatchExecuteStatementInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchExecuteStatementOutput, error)
}

DynamoDBAPI interface for the dynamobd api to enable testing.

type PostgresAPI

type PostgresAPI interface {
	Query(query string, args ...any) (*sql.Rows, error)
	QueryRow(query string, args ...any) *sql.Row
	Exec(query string, args ...any) (sql.Result, error)
	Prepare(query string) (*sql.Stmt, error)
	Close() error
}

type S3API

type S3API interface {
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
}

type SnsAPI

type SnsAPI interface {
	PublishBatch(ctx context.Context, params *sns.PublishBatchInput, optFns ...func(*sns.Options)) (*sns.PublishBatchOutput, error)
}

Jump to

Keyboard shortcuts

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