kvstore

package module
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDynamoDB

func InitDynamoDB(tableName string) (pkvs *kvstore_dynamodb, err interface{})

uses default aws credential loading i.e. AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_REGION the table must already exist with primary key "key"

func InitEtcd

func InitEtcd(endpoints []string, keyprefix string) (pkvs *kvstore_etcd, err interface{})

func InitFilesystem

func InitFilesystem(path string, createPath bool, pathMode os.FileMode, fileMode os.FileMode) (pkvs *kvstore_filesystem, err interface{})

func InitPostgres

func InitPostgres(connStr, tblName string, createTable bool) (pkvs *kvstore_postgres, err interface{})

connStr example: postgres://username:password@localhost:5432/database_name

func InitS3 added in v0.13.0

func InitS3(bucketName, keyPrefix string) (pkvs *kvstore_s3, err interface{})

uses default aws credential loading i.e. AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_REGION the table must already exist with primary key "key"

Types

type KVStore

type KVStore interface {
	Save(key, value string) (err interface{})
	Load(key, default_value string) (value string, err interface{})
	Delete(key string) (err interface{})
	Close() (err interface{})
}

Jump to

Keyboard shortcuts

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