feat: establish Orbit models, migrations and development baseline

This commit is contained in:
2026-09-17 07:04:21 +08:00
commit 4f2935e36f
84 changed files with 4915 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
// Run against a started bootstrap server: ORBIT_URL=http://127.0.0.1:8080 go run ./examples/health
package main
import (
"context"
"fmt"
orbit "git.yuntuo.hk/k2safe/orbit/sdk/go"
"log"
"os"
"time"
)
func main() {
address := os.Getenv("ORBIT_URL")
if address == "" {
address = "http://127.0.0.1:8080"
}
client, err := orbit.NewClient(address, orbit.Options{})
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
live, err := client.Liveness(ctx)
if err != nil {
log.Fatal(err)
}
ready, err := client.Readiness(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("liveness=%s readiness=%s scope=%s\n", live.Status, ready.Status, ready.Scope)
}