dynamox

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package dynamox contains DynamoDB utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTableIfNotExists

func CreateTableIfNotExists(
	ctx context.Context,
	client *dynamodb.Client,
	table string,
	onRequest func(any) []func(*dynamodb.Options),
	key ...KeyAttr,
) error

CreateTableIfNotExists creates a DynamoDB table if it does not exist.

func DeleteTableIfExists

func DeleteTableIfExists(
	ctx context.Context,
	client *dynamodb.Client,
	table string,
	onRequest func(any) []func(*dynamodb.Options),
) error

DeleteTableIfExists deletes a DynamoDB table if it exists.

func QueryRange

func QueryRange(
	ctx context.Context,
	client *dynamodb.Client,
	m func(any) []func(*dynamodb.Options),
	in *dynamodb.QueryInput,
	fn func(context.Context, map[string]types.AttributeValue) (bool, error),
) error

QueryRange executes a query and calls fn for each item in the result set.

Types

type KeyAttr

type KeyAttr struct {
	Name    *string
	Type    types.ScalarAttributeType
	KeyType types.KeyType
}

KeyAttr describes a key attribute of a DynamoDB table.

Jump to

Keyboard shortcuts

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