]> 91.132.146.200 Git - scientia.git/commitdiff
online first. offline and sync later
authorBanana <mail@bananas-playground.net>
Sat, 20 Jul 2024 10:19:26 +0000 (12:19 +0200)
committerBanana <mail@bananas-playground.net>
Sat, 20 Jul 2024 10:19:26 +0000 (12:19 +0200)
Signed-off-by: Banana <mail@bananas-playground.net>
TODO
client/go-cli/scientia/cmd/pull.go [deleted file]
documentation/scructure/structure-add.d2 [new file with mode: 0644]
documentation/scructure/structure-edit.d2 [new file with mode: 0644]
documentation/scructure/structure-main.d2 [new file with mode: 0644]
documentation/structure-main.d2 [deleted file]

diff --git a/TODO b/TODO
index 2f31807140f3e892c74855d4aa9e84fb93bf8d9f..a02d8f65b811a49d5628e839ff87e577304fdee4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,3 +3,4 @@
 + PHP better logging
 + PHP Better API
 + Go client improvements
+++ local storage and sync
diff --git a/client/go-cli/scientia/cmd/pull.go b/client/go-cli/scientia/cmd/pull.go
deleted file mode 100644 (file)
index 485e094..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package cmd
-
-import (
-       "fmt"
-       "github.com/spf13/cobra"
-       "io"
-       "os"
-       Helper "scientia/lib"
-)
-
-func init() {
-       rootCmd.AddCommand(pullCmd)
-}
-
-var pullCmd = &cobra.Command {
-       Use: "pull",
-       Short: "Download",
-       Long: "Add a new entry based on a file or piped cat file | scientia add. Returns the url to the new entry.",
-       Run: func(cmd *cobra.Command, args []string) {
-               // check if there is a file or piped content
-               var inputString string
-
-               if len(args) == 1 {
-                       if FlagVerbose {
-                               fmt.Println("Read from file argument")
-                       }
-                       bytes, err := os.ReadFile(args[0])
-                       Helper.ErrorCheck(err, "Error opening file")
-                       inputString = string(bytes)
-               } else if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0  {
-                       if FlagVerbose {
-                               fmt.Println("Read from piped stdin")
-                       }
-                       bytes, _ := io.ReadAll(os.Stdin)
-                       inputString = string(bytes)
-               } else {
-                       cmd.Help()
-                       os.Exit(0)
-               }
-
-               response := upload(inputString)
-
-               // print the result and link to the pasty
-               fmt.Printf("Status: %d\n", response.Status)
-               fmt.Printf("Message: %s\n", response.Message)
-       },
-}
diff --git a/documentation/scructure/structure-add.d2 b/documentation/scructure/structure-add.d2
new file mode 100644 (file)
index 0000000..12a71d4
--- /dev/null
@@ -0,0 +1,7 @@
+add_param: file or stdin
+add_param.shape: oval
+server: server
+server.shape: cloud
+
+add -> add_param
+add_param -> server
diff --git a/documentation/scructure/structure-edit.d2 b/documentation/scructure/structure-edit.d2
new file mode 100644 (file)
index 0000000..a23f2cc
--- /dev/null
@@ -0,0 +1,10 @@
+edit_list: list
+edit_id: id
+
+server: server
+server.shape: cloud
+
+edit -> edit_list
+edit -> edit_id
+edit_list <-> server
+edit_id <-> server
diff --git a/documentation/scructure/structure-main.d2 b/documentation/scructure/structure-main.d2
new file mode 100644 (file)
index 0000000..aed8a43
--- /dev/null
@@ -0,0 +1,20 @@
+sc: scientia
+cfg: config
+cfg_edit: edit
+cfg_init: init
+cfg_read: read
+add: add
+edit: edit
+edit_id: id
+edit_list: list
+
+sc -> cfg
+cfg -> cfg_init
+cfg -> cfg_edit
+cfg -> cfg_read
+
+sc -> add
+
+sc -> edit
+edit -> edit_id
+edit -> edit_list
diff --git a/documentation/structure-main.d2 b/documentation/structure-main.d2
deleted file mode 100644 (file)
index e77ea19..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-sc: scientia
-cfg: config
-cfg_edit: edit
-cfg_init: init
-cfg_read: read
-add: add
-pull: pull
-push: push
-sync: sync
-edit: edit
-edit_id: id
-edit_list: list
-
-sc -> cfg
-cfg -> cfg_init
-cfg -> cfg_edit
-cfg -> cfg_read
-
-sc -> add
-sc -> pull
-sc -> push
-sc -> sync
-
-sc -> edit
-edit -> edit_id
-edit -> edit_list