S06-S08: Python spec, Go in-process leaf, tests and Forgejo CI
Some checks are pending
ci / python (push) Waiting to run
ci / go (push) Waiting to run

This commit is contained in:
George Lambert 2026-09-15 22:17:19 -04:00
commit d67509e470
16 changed files with 726 additions and 0 deletions

26
go/cmd/sm-leaf/main.go Normal file
View file

@ -0,0 +1,26 @@
// sm-leaf: in-process NATS core plus optional leaf to the Verae hub.
package main
import (
"flag"
"log"
"os"
"os/signal"
"syscall"
"github.com/marchon/secure-messaging/internal/leaf"
)
func main() {
hub := flag.String("hub", os.Getenv("SM_LEAF_HUB"), "leaf hub URL, e.g. nats-leaf://10.10.10.21:7422")
flag.Parse()
n, err := leaf.Start(*hub)
if err != nil {
log.Fatal(err)
}
log.Printf("sm-leaf in-process nats %s hub=%q", n.Addr(), *hub)
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
<-ch
_ = n.Shutdown()
}