mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
Updated Nitpicks
This commit is contained in:
@@ -9,7 +9,7 @@ title: Aerospike
|
|||||||
|
|
||||||
A Aerospike client driver using `aerospike/aerospike-client-go` and [aerospike/aerospike-client-go](https://github.com/aerospike/aerospike-client-go).
|
A Aerospike client driver using `aerospike/aerospike-client-go` and [aerospike/aerospike-client-go](https://github.com/aerospike/aerospike-client-go).
|
||||||
|
|
||||||
**Note: Requires Go 1.19 and above**
|
**Note: Requires Go 1.23 and above**
|
||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
@@ -16,6 +16,10 @@ const (
|
|||||||
aerospikeNamespace = "test"
|
aerospikeNamespace = "test"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// setupAerospikeTestClient sets up a test Aerospike client
|
||||||
|
// using testcontainers-go. It starts an Aerospike container and returns
|
||||||
|
// a Storage instance configured to connect to the container.
|
||||||
|
// The container is cleaned up after the test completes.
|
||||||
func setupAerospikeTestClient(t *testing.T) *Storage {
|
func setupAerospikeTestClient(t *testing.T) *Storage {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
@@ -26,6 +30,8 @@ func setupAerospikeTestClient(t *testing.T) *Storage {
|
|||||||
t.Fatalf("Failed to start aerospike container: %v", err)
|
t.Fatalf("Failed to start aerospike container: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testcontainers.CleanupContainer(t, c)
|
||||||
|
|
||||||
// Extract host and port
|
// Extract host and port
|
||||||
host, err := c.Host(context.TODO())
|
host, err := c.Host(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -37,11 +43,6 @@ func setupAerospikeTestClient(t *testing.T) *Storage {
|
|||||||
t.Fatalf("Failed to get container port: %v", err)
|
t.Fatalf("Failed to get container port: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
testcontainers.CleanupContainer(t, c)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Failed to cleanup Aerospike container: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return New(Config{
|
return New(Config{
|
||||||
Hosts: []*aerospike.Host{aerospike.NewHost(host, port.Int())},
|
Hosts: []*aerospike.Host{aerospike.NewHost(host, port.Int())},
|
||||||
Reset: true,
|
Reset: true,
|
||||||
@@ -70,7 +71,7 @@ func Test_AeroSpikeDB_Get(t *testing.T) {
|
|||||||
require.Equal(t, val, retrievedVal)
|
require.Equal(t, val, retrievedVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test_AeroSpikeDB_Set tests the Set method
|
// Test_AeroSpikeDB_Delete tests the Delete method
|
||||||
func Test_AeroSpikeDB_Delete(t *testing.T) {
|
func Test_AeroSpikeDB_Delete(t *testing.T) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Reference in New Issue
Block a user