Skip to content

Commit b64a04c

Browse files
committed
Refactor SnapshotStore interface to use context.Context for improved context management in API handlers.
1 parent 40c77b2 commit b64a04c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

excalidraw-server/handlers/api/snapshots/snapshots.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package snapshots
22

33
import (
4+
"context"
45
"encoding/json"
56
"excalidraw-server/stores/sqlite"
67
"io"
@@ -36,13 +37,13 @@ type (
3637
}
3738

3839
SnapshotStore interface {
39-
CreateSnapshot(ctx interface{}, roomID, name, description, thumbnail, createdBy string, data []byte) (string, error)
40-
ListSnapshots(ctx interface{}, roomID string) ([]sqlite.Snapshot, error)
41-
GetSnapshot(ctx interface{}, id string) (*sqlite.Snapshot, error)
42-
DeleteSnapshot(ctx interface{}, id string) error
43-
UpdateSnapshotMetadata(ctx interface{}, id, name, description string) error
44-
GetRoomSettings(ctx interface{}, roomID string) (*sqlite.RoomSettings, error)
45-
UpdateRoomSettings(ctx interface{}, roomID string, maxSnapshots, autoSaveInterval int) error
40+
CreateSnapshot(ctx context.Context, roomID, name, description, thumbnail, createdBy string, data []byte) (string, error)
41+
ListSnapshots(ctx context.Context, roomID string) ([]sqlite.Snapshot, error)
42+
GetSnapshot(ctx context.Context, id string) (*sqlite.Snapshot, error)
43+
DeleteSnapshot(ctx context.Context, id string) error
44+
UpdateSnapshotMetadata(ctx context.Context, id, name, description string) error
45+
GetRoomSettings(ctx context.Context, roomID string) (*sqlite.RoomSettings, error)
46+
UpdateRoomSettings(ctx context.Context, roomID string, maxSnapshots, autoSaveInterval int) error
4647
}
4748
)
4849

0 commit comments

Comments
 (0)