func (s *Storage) Delete(key string) error {
	if len(key) <= 0 {
		return nil
	}
	_, err := s.collection.RemoveDocument(context.Background(), key)
	return err
}
Delete value by key
package arangodb
import (
	"context"
	"fmt"
	"time"
	"github.com/arangodb/go-driver"
	"github.com/arangodb/go-driver/http"
	"github.com/gofiber/utils"
)
type Storage struct {
	db         driver.Database
	gcInterval time.Duration
	done       chan struct{}
	connection    driver.Connection
	client        driver.Client
	collection    driver.Collection
	bindingParams map[string]interface{}
	config        Config
	aqlRemoveGC string
}
type model struct {
	Key string `json:"_key"`
	Val string `json:"val"`
	Exp int64  `json:"exp"`
}
func New(config ...Config) *Storage {
	cfg := configDefault(config...)
	conn, err := http.NewConnection(http.ConnectionConfig{
		Endpoints: []string{fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)},
	})
	if err != nil {
		panic(err)
	}
	client, err := driver.NewClient(driver.ClientConfig{
		Connection:     conn,
		Authentication: driver.BasicAuthentication(cfg.Username, cfg.Password),
	})
	if err != nil {
		panic(err)
	}
	exists, err := client.DatabaseExists(context.Background(), cfg.Database)
	if err != nil {
		panic(err)
	}
	if !exists {
		_, err = client.CreateDatabase(context.Background(), cfg.Database, nil)
		if err != nil {
			panic(err)
		}
	}
	database, err := client.Database(context.Background(), cfg.Database)
	if err != nil {
		panic(err)
	}
	found, _ := database.CollectionExists(context.Background(), cfg.Collection)
	var collection driver.Collection
	if !found {
		collection, err = database.CreateCollection(context.Background(), cfg.Collection, &driver.CreateCollectionOptions{})
		if err != nil {
			panic(err)
		}
	} else {
		collection, err = database.Collection(context.Background(), cfg.Collection)
		if err != nil {
			panic(err)
		}
	}
	if cfg.Reset {
		err = collection.Truncate(context.Background())
		if err != nil {
			panic(err)
		}
	}
	store := &Storage{
		gcInterval:  cfg.GCInterval,
		db:          database,
		collection:  collection,
		client:      client,
		connection:  conn,
		config:      cfg,
		done:        make(chan struct{}),
		aqlRemoveGC: fmt.Sprintf("FOR doc IN %s\n  FILTER doc.exp <= @exp \n REMOVE { _key: doc._key } IN %s", collection.Name(), collection.Name()),
	}
	go store.gc()
	return store
}
func (s *Storage) Get(key string) ([]byte, error) {
	if len(key) <= 0 {
		return nil, nil
	}
	ctx := context.Background()
	exists, err := s.collection.DocumentExists(ctx, key)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, nil
	}
	var model model
	_, err = s.collection.ReadDocument(ctx, key, &model)
	if err != nil {
		return nil, err
	}
	if model.Exp != 0 && model.Exp <= time.Now().Unix() {
		return nil, nil
	}
	return utils.UnsafeBytes(model.Val), nil
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
	if len(key) <= 0 || len(val) <= 0 {
		return nil
	}
	var expireAt int64
	if exp != 0 {
		expireAt = time.Now().Add(exp).Unix()
	}
	valStr := utils.UnsafeString(val)
	data := model{
		Key: key,
		Val: valStr,
		Exp: expireAt,
	}
	ctx := context.Background()
	exists, err := s.collection.DocumentExists(ctx, key)
	if err != nil {
		return err
	}
	if exists {
		_, err = s.collection.UpdateDocument(ctx, key, data)
		return err
	}
	_, err = s.collection.CreateDocument(ctx, data)
	return err
}