session

package
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Overview

Package session provides AWS session management and DynamoDB client configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AWS region
	Region string

	// Optional endpoint for local development (e.g., DynamoDB Local)
	Endpoint string

	// Maximum number of retries for failed requests
	MaxRetries int

	// Default read capacity units for table creation
	DefaultRCU int64

	// Default write capacity units for table creation
	DefaultWCU int64

	// Whether to automatically create tables if they don't exist
	AutoMigrate bool

	// Whether to enable metrics collection
	EnableMetrics bool

	// Custom AWS config options
	AWSConfigOptions []func(*config.LoadOptions) error

	// Custom DynamoDB client options
	DynamoDBOptions []func(*dynamodb.Options)

	// Credentials provider
	CredentialsProvider aws.CredentialsProvider
}

Config holds the configuration for DynamORM

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

type Session

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

Session manages the AWS session and DynamoDB client

func NewSession

func NewSession(cfg *Config) (*Session, error)

NewSession creates a new session with the given configuration

func (*Session) AWSConfig

func (s *Session) AWSConfig() aws.Config

AWSConfig returns the AWS configuration

func (*Session) Client

func (s *Session) Client() (*dynamodb.Client, error)

Client returns the DynamoDB client

func (*Session) Config

func (s *Session) Config() *Config

Config returns the session configuration

func (*Session) WithContext

func (s *Session) WithContext(ctx context.Context) *Session

WithContext returns a new session with the given context

Jump to

Keyboard shortcuts

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