summaryrefslogtreecommitdiffstats
path: root/internal/api
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-09-30 21:50:36 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-09-30 21:50:36 -0700
commitc2ca26a918b7054199234e8459d84ee2fd260759 (patch)
treea44f8dad1ca70eb25d4dc12bf17e136fd0711e04 /internal/api
parented285a247a3a967e02f428fa2b6e69d629e2bd14 (diff)
downloadroseh.moe-c2ca26a918b7054199234e8459d84ee2fd260759.tar.zst
Allow appending to notes
Right now it's n^2 which is a big problem (to be fixed later)
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/api.go9
-rw-r--r--internal/api/errorcode_string.go9
2 files changed, 11 insertions, 7 deletions
diff --git a/internal/api/api.go b/internal/api/api.go
index 7c8472a..b925a7a 100644
--- a/internal/api/api.go
+++ b/internal/api/api.go
@@ -11,6 +11,7 @@ const (
Unauthenticated // missing credentials
PermissionDenied // invalid credentials, or login required
BadRequest // incorrect request format (try gob)
+ InvalidArgument // one or more arguments was invalid
NotFound // requested resource was not found
Internal // server encountered an unexpected error
)
@@ -35,12 +36,14 @@ type ListNotesResponse struct {
Notes []string
}
-type CreateNoteRequestStream struct {
- Chunk []byte
+type CreateNoteRequest struct {
+ ContinuationToken []byte
+ Chunk []byte
}
type CreateNoteResponse struct {
- Name string
+ Name string
+ ContinuationToken []byte
}
type ReadNoteRequest struct {
diff --git a/internal/api/errorcode_string.go b/internal/api/errorcode_string.go
index 2b4a294..5ff2ff0 100644
--- a/internal/api/errorcode_string.go
+++ b/internal/api/errorcode_string.go
@@ -12,13 +12,14 @@ func _() {
_ = x[Unauthenticated-1]
_ = x[PermissionDenied-2]
_ = x[BadRequest-3]
- _ = x[NotFound-4]
- _ = x[Internal-5]
+ _ = x[InvalidArgument-4]
+ _ = x[NotFound-5]
+ _ = x[Internal-6]
}
-const _ErrorCode_name = "OkUnauthenticatedPermissionDeniedBadRequestNotFoundInternal"
+const _ErrorCode_name = "OkUnauthenticatedPermissionDeniedBadRequestInvalidArgumentNotFoundInternal"
-var _ErrorCode_index = [...]uint8{0, 2, 17, 33, 43, 51, 59}
+var _ErrorCode_index = [...]uint8{0, 2, 17, 33, 43, 58, 66, 74}
func (i ErrorCode) String() string {
if i < 0 || i >= ErrorCode(len(_ErrorCode_index)-1) {