add command add-link to kontor-cli
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user