add command add-link to kontor-cli
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s

This commit is contained in:
2026-10-03 01:35:26 +02:00
parent 4aaf580735
commit ea648082be
3 changed files with 62 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package cmd
import (
"log/slog"
"github.com/JanikL/go-artemis/artemis"
"github.com/spf13/cobra"
)
var addLinkCmd = &cobra.Command{
Use: "add-link",
Short: "Add Link",
Long: "Add Link to Kontor Database",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
slog.Info("add-link kontor started")
sender := artemis.Sender{Addr: "localhost:61616", Dest: "add-link", Enc: artemis.EncodingJson}
err := sender.Send("{ \"url\": \"https://example.com\" }")
if err != nil {
slog.Info("send failed", "error", err.Error())
}
slog.Info("add-link kontor finished")
},
}
func init() {
rootCmd.AddCommand(addLinkCmd)
}