summaryrefslogtreecommitdiffstats
path: root/internal/api/api.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-10-05 18:00:06 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-10-05 18:00:06 -0700
commitd89b325294201d95498ae9d08f102e12ac2f2876 (patch)
treeffe65e33d0d01e811a5323d5e40c47564ccb8f2d /internal/api/api.go
parent624985afaaa8b94e4d9685bcdc935d467f9e7060 (diff)
downloadroseh.moe-d89b325294201d95498ae9d08f102e12ac2f2876.tar.zst
Implement a "magic wormhole" file-sharing solution
Diffstat (limited to 'internal/api/api.go')
-rw-r--r--internal/api/api.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/internal/api/api.go b/internal/api/api.go
deleted file mode 100644
index 6c9ab3a..0000000
--- a/internal/api/api.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Package api contains type definitions for the gob API.
-package api
-
-import "encoding/gob"
-
-type ErrorCode int
-
-//go:generate go tool stringer -type=ErrorCode
-const (
- Ok ErrorCode = iota
- 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
-)
-
-func (c ErrorCode) Error() string {
- return c.String()
-}
-
-type Response struct {
- Status ErrorCode
- Err string
- Ok any
-}
-
-type LoginResponse struct {
- Token string
-}
-
-type ListNotesRequest struct{}
-
-type ListNotesResponse struct {
- Notes []string
-}
-
-type CreateNoteRequest struct {
- ContinuationToken []byte
- FileName string
- Chunk []byte
- More bool
-}
-
-type CreateNoteResponse struct {
- Name string
- ContinuationToken []byte
-}
-
-type ReadNoteRequest struct {
- Note string
-}
-
-type ReadNoteResponseStream struct {
- FileName string
- Chunk []byte
-}
-
-type DeleteNoteRequest struct{}
-
-type DeleteNoteResponse struct{}
-
-func init() {
- gob.Register(&LoginResponse{})
- gob.Register(&ListNotesResponse{})
- gob.Register(&CreateNoteResponse{})
- gob.Register(&ReadNoteResponseStream{})
- gob.Register(&DeleteNoteResponse{})
-}