kvparams

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type     string
	Postgres *Postgres
	DynamoDB *DynamoDB
	Local    *Local
	CosmosDB *CosmosDB
}

func NewConfig

func NewConfig(cfg *config.Config) (Config, error)

type CosmosDB

type CosmosDB struct {
	Key        string
	Endpoint   string
	Database   string
	Container  string
	Throughput int32
	Autoscale  bool
	// These values should only be set to false for testing purposes using the CosmosDB emulator
	Client            *http.Client
	StrongConsistency bool
}

type DynamoDB

type DynamoDB struct {
	// The name of the DynamoDB table to be used as KV
	TableName string

	// Maximal number of items per page during scan operation
	ScanLimit int64

	// Specifies the maximum number attempts to make on a request.
	MaxAttempts int

	// The endpoint URL of the DynamoDB endpoint
	// Can be used to redirect to DynamoDB on AWS, local docker etc.
	Endpoint string

	// AWS connection details - region, profile and credentials
	// This will override any such details that are already exist in the system
	// While in general, AWS region and credentials are configured in the system for AWS usage,
	// these can be used to specify fake values, that cna be used to connect to local DynamoDB,
	// in case there are no credentials configured in the system
	// This is a client requirement as described in section 4 in
	// https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html
	AwsRegion             string
	AwsProfile            string
	AwsAccessKeyID        string
	AwsSecretAccessKey    string
	HealthCheckInterval   time.Duration
	MaxConnectionsPerHost int
}

type Local

type Local struct {
	// Path - Local directory path to store the DB files
	Path string
	// SyncWrites - Sync ensures data written to disk on each writing instead of mem cache
	SyncWrites bool
	// PrefetchSize - Number of elements to prefetch while iterating
	PrefetchSize int
	// EnableLogging - Enable store and badger (trace only) logging
	EnableLogging bool
}

type Postgres

type Postgres struct {
	ConnectionString      string
	MaxOpenConnections    int32
	MaxIdleConnections    int32
	ConnectionMaxLifetime time.Duration
	ScanPageSize          int
	Metrics               bool
}

Jump to

Keyboard shortcuts

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