Files
storage/dynamodb
2020-11-12 03:34:37 +01:00
..
2020-11-12 03:34:37 +01:00
2020-11-12 03:34:37 +01:00
2020-11-12 03:34:37 +01:00
2020-11-12 03:34:37 +01:00
2020-11-12 03:34:37 +01:00

DynamoDB

....

Table of Contents

Signatures

func New(config ...Config) Storage

var ErrNotExist = errors.New("key does not exist")

func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error

Installation

DynamoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the dynamodb implementation:

go get github.com/gofiber/storage/dynamodb

Examples

Import the storage package.

import "github.com/gofiber/storage/dynamodb"

You can use the following possibilities to create a storage:

// Initialize default config
store := dynamodb.New()

// Initialize custom config
store := dynamodb.New(dynamodb.Config{
	
})

Config

type Config struct {

}

Default Config

var ConfigDefault = Config{

}