MCPcopy
hub / github.com/gofiber/fiber / Storage

Interface Storage

storage_interface.go:10–46  ·  storage_interface.go::Storage

Storage interface for communicating with different database/key-value providers

Source from the content-addressed store, hash-verified

8// Storage interface for communicating with different database/key-value
9// providers
10type Storage interface {
11 // GetWithContext gets the value for the given key with a context.
12 // `nil, nil` is returned when the key does not exist
13 GetWithContext(ctx context.Context, key string) ([]byte, error)
14
15 // Get gets the value for the given key.
16 // `nil, nil` is returned when the key does not exist
17 Get(key string) ([]byte, error)
18
19 // SetWithContext stores the given value for the given key
20 // with an expiration value, 0 means no expiration.
21 // Empty key or value will be ignored without an error.
22 SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
23
24 // Set stores the given value for the given key along
25 // with an expiration value, 0 means no expiration.
26 // Empty key or value will be ignored without an error.
27 Set(key string, val []byte, exp time.Duration) error
28
29 // DeleteWithContext deletes the value for the given key with a context.
30 // It returns no error if the storage does not contain the key,
31 DeleteWithContext(ctx context.Context, key string) error
32
33 // Delete deletes the value for the given key.
34 // It returns no error if the storage does not contain the key,
35 Delete(key string) error
36
37 // ResetWithContext resets the storage and deletes all keys with a context.
38 ResetWithContext(ctx context.Context) error
39
40 // Reset resets the storage and delete all keys.
41 Reset() error
42
43 // Close closes the storage and will stop any running garbage
44 // collectors and open connections.
45 Close() error
46}

Callers 59

GetWithContextMethod · 0.65
GetWithContextMethod · 0.65
HasWithContextMethod · 0.65
getEncodedWithContextMethod · 0.65
getMethod · 0.65
getRawMethod · 0.65
GetWithContextMethod · 0.65
SaveFileToStorageMethod · 0.65
SetWithContextMethod · 0.65
SetWithContextMethod · 0.65

Implementers 15

shutdownHookStorageservices_test.go
errorStorageshared_state_test.go
contextCheckingStorageshared_state_test.go
SharedStateshared_state.go
captureStoragectx_test.go
failingStoragectx_test.go
mutatingStoragemiddleware/cache/cache_test.go
failingCacheStoragemiddleware/cache/cache_test.go
failingCSRFStoragemiddleware/csrf/csrf_test.go
flakySessionStoragemiddleware/csrf/csrf_test.go
stubStoragemiddleware/idempotency/stub_test.go

Calls

no outgoing calls

Tested by

no test coverage detected