Files
kontor/kontor-gin/internal/cmd/add-link.go
T
tpeetz ea648082be
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
add command add-link to kontor-cli
2026-10-03 01:35:26 +02:00

29 lines
656 B
Go

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)
}