aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-05-12 10:50:04 -0400
committerXe Iaso <me@xeiaso.net>2024-05-12 10:50:04 -0400
commitc1a685f81d936fe87673126b9318c78fa21bda94 (patch)
tree707150ccacd513bed754d99da36cc987089b3a62
parent576cfc23c0cbd6c2499942c483a1ed465c3baaf8 (diff)
downloadx-c1a685f81d936fe87673126b9318c78fa21bda94.tar.xz
x-c1a685f81d936fe87673126b9318c78fa21bda94.zip
cmd/mi: implement service
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--.go.mod.sri2
-rw-r--r--cmd/mi/import.go132
-rw-r--r--cmd/mi/main.go50
-rw-r--r--cmd/mi/models/member.go21
-rw-r--r--cmd/mi/models/switch.go41
-rw-r--r--cmd/mi/server.go126
-rw-r--r--cmd/mi/testdata/members.json32
-rw-r--r--cmd/mi/var/.gitignore2
-rw-r--r--flake.nix19
-rw-r--r--go.mod6
-rw-r--r--go.sum10
-rw-r--r--proto/mi.proto6
-rw-r--r--proto/mi/mi.pb.go88
-rw-r--r--proto/mi/mi.twirp.go72
-rw-r--r--proto/mi/mi_grpc.pb.go2
15 files changed, 521 insertions, 88 deletions
diff --git a/.go.mod.sri b/.go.mod.sri
index 21a0efa..86bd6db 100644
--- a/.go.mod.sri
+++ b/.go.mod.sri
@@ -1 +1 @@
-sha256-2L8g1D0eqC8vLqoytxL8gmMxOrv2+9veJx+NQv5oI4M=
+sha256-NOymNGq2Ea1DWMs/8L30tAEzqSvZcp7TvxV4a8tnuGM=
diff --git a/cmd/mi/import.go b/cmd/mi/import.go
new file mode 100644
index 0000000..661cb70
--- /dev/null
+++ b/cmd/mi/import.go
@@ -0,0 +1,132 @@
+package main
+
+import (
+ "encoding/csv"
+ "encoding/json"
+ "log/slog"
+ "net/http"
+ "strconv"
+ "time"
+
+ "gorm.io/gorm"
+ "within.website/x/cmd/mi/models"
+ pb "within.website/x/proto/mi"
+)
+
+const timeLayout = "2006-01-02 15:04:05"
+
+type Importer struct {
+ db *gorm.DB
+}
+
+func (i *Importer) Mount(mux *http.ServeMux) {
+ mux.HandleFunc("/.within/mi/import/switches", i.importSwitches)
+ mux.HandleFunc("/.within/mi/import/members", i.importMembers)
+}
+
+func (i *Importer) importSwitches(w http.ResponseWriter, r *http.Request) {
+ rdr := csv.NewReader(r.Body)
+ defer r.Body.Close()
+
+ tx := i.db.Begin()
+
+ for {
+ row, err := rdr.Read()
+ if err != nil {
+ break
+ }
+
+ if len(row) != 4 {
+ slog.Error("invalid row", "row", row)
+ continue
+ }
+
+ id := row[0]
+ memberIDStr := row[1]
+ startedAtStr := row[2]
+ endedAtStr := row[3]
+
+ memberID, err := strconv.Atoi(memberIDStr)
+ if err != nil {
+ slog.Error("failed to parse member ID", "err", err)
+ continue
+ }
+
+ startedAt, err := time.Parse(timeLayout, startedAtStr)
+ if err != nil {
+ slog.Error("failed to parse started at", "err", err)
+ continue
+ }
+
+ var endedAt *time.Time
+ if endedAtStr != "" {
+ endedAtTime, err := time.Parse(timeLayout, endedAtStr)
+ if err != nil {
+ slog.Error("failed to parse ended at", "err", err, "endedAtStr", endedAtStr)
+ continue
+ }
+
+ endedAt = &endedAtTime
+ }
+
+ var member models.Member
+ if err := tx.Where("id = ?", memberID).First(&member).Error; err != nil {
+ slog.Error("failed to find member", "err", err, "memberID", memberID)
+ continue
+ }
+
+ sw := models.Switch{
+ ID: id,
+ MemberID: memberID,
+ Model: gorm.Model{
+ CreatedAt: startedAt,
+ },
+ EndedAt: endedAt,
+ }
+
+ if err := tx.Save(&sw).Error; err != nil {
+ slog.Error("failed to save switch", "err", err)
+ continue
+ }
+ }
+
+ if err := tx.Commit().Error; err != nil {
+ slog.Error("failed to commit transaction", "err", err)
+ http.Error(w, "failed to commit transaction", http.StatusInternalServerError)
+ return
+ }
+
+ w.WriteHeader(http.StatusOK)
+}
+
+func (i *Importer) importMembers(w http.ResponseWriter, r *http.Request) {
+ var members []pb.Member
+ if err := json.NewDecoder(r.Body).Decode(&members); err != nil {
+ slog.Error("failed to decode members", "err", err)
+ http.Error(w, "failed to decode members", http.StatusBadRequest)
+ return
+ }
+ defer r.Body.Close()
+
+ tx := i.db.Begin()
+
+ for _, m := range members {
+ member := models.Member{
+ ID: int(m.Id),
+ Name: m.Name,
+ AvatarURL: m.AvatarUrl,
+ }
+
+ if err := tx.Exec("INSERT INTO members (id, name, avatar_url) VALUES (?, ?, ?) ON CONFLICT (id) DO UPDATE SET name = ?, avatar_url = ?", member.ID, member.Name, member.AvatarURL, member.Name, member.AvatarURL).Error; err != nil {
+ slog.Error("failed to save member", "err", err)
+ http.Error(w, "failed to save member", http.StatusInternalServerError)
+ return
+ }
+ }
+
+ if err := tx.Commit().Error; err != nil {
+ slog.Error("failed to commit transaction", "err", err)
+ http.Error(w, "failed to commit transaction", http.StatusInternalServerError)
+ return
+ }
+}
diff --git a/cmd/mi/main.go b/cmd/mi/main.go
new file mode 100644
index 0000000..a904a9b
--- /dev/null
+++ b/cmd/mi/main.go
@@ -0,0 +1,50 @@
+package main
+
+import (
+ "flag"
+ "log/slog"
+ "net/http"
+ "os"
+
+ slogGorm "github.com/orandin/slog-gorm"
+ "gorm.io/driver/sqlite"
+ "gorm.io/gorm"
+ "within.website/x/cmd/mi/models"
+ "within.website/x/internal"
+ pb "within.website/x/proto/mi"
+)
+
+var (
+ bind = flag.String("bind", ":8080", "HTTP bind address")
+ dbLoc = flag.String("db-loc", "./var/data.db", "")
+)
+
+func main() {
+ internal.HandleStartup()
+
+ db, err := gorm.Open(sqlite.Open(*dbLoc), &gorm.Config{
+ Logger: slogGorm.New(
+ slogGorm.WithErrorField("err"),
+ slogGorm.WithRecordNotFoundError(),
+ ),
+ })
+ if err != nil {
+ slog.Error("failed to connect to database", "err", err)
+ os.Exit(1)
+ }
+
+ if err := db.AutoMigrate(&models.Member{}, &models.Switch{}); err != nil {
+ slog.Error("failed to migrate schema", "err", err)
+ os.Exit(1)
+ }
+
+ mux := http.NewServeMux()
+
+ mux.Handle(pb.SwitchTrackerPathPrefix, pb.NewSwitchTrackerServer(NewSwitchTracker(db)))
+
+ i := &Importer{db: db}
+ i.Mount(mux)
+
+ slog.Info("starting server", "bind", *bind)
+ slog.Error("server stopped", "err", http.ListenAndServe(*bind, mux))
+}
diff --git a/cmd/mi/models/member.go b/cmd/mi/models/member.go
new file mode 100644
index 0000000..cbce48b
--- /dev/null
+++ b/cmd/mi/models/member.go
@@ -0,0 +1,21 @@
+package models
+
+import (
+ pb "within.website/x/proto/mi"
+)
+
+// Member is a member of the Within system.
+type Member struct {
+ ID int // unique number to use as a primary key
+ Name string `gorm:"uniqueIndex"` // the name of the member
+ AvatarURL string // public URL to the member's avatar
+}
+
+// AsProto converts a Member to its protobuf representation.
+func (m Member) AsProto() *pb.Member {
+ return &pb.Member{
+ Id: int32(m.ID),
+ Name: m.Name,
+ AvatarUrl: m.AvatarURL,
+ }
+}
diff --git a/cmd/mi/models/switch.go b/cmd/mi/models/switch.go
new file mode 100644
index 0000000..ec85a1c
--- /dev/null
+++ b/cmd/mi/models/switch.go
@@ -0,0 +1,41 @@
+package models
+
+import (
+ "time"
+
+ "gorm.io/gorm"
+ pb "within.website/x/proto/mi"
+)
+
+// Switch is a record of the system switching front to a different member.
+type Switch struct {
+ gorm.Model // adds CreatedAt, UpdatedAt, DeletedAt
+ ID string `gorm:"uniqueIndex"` // unique identifier for the switch (ULID usually)
+ EndedAt *time.Time // when the switch ends, different from DeletedAt
+ MemberID int // the member who is now in front
+ Member Member `gorm:"foreignKey:MemberID"`
+}
+
+// AsProto converts a Switch to its protobuf representation.
+func (s Switch) AsProto() *pb.Switch {
+ var endedAt string
+
+ if s.EndedAt != nil {
+ endedAt = s.EndedAt.Format(time.RFC3339)
+ }
+
+ return &pb.Switch{
+ Id: s.ID,
+ StartedAt: s.CreatedAt.Format(time.RFC3339),
+ EndedAt: endedAt,
+ MemberId: int32(s.MemberID),
+ }
+}
+
+// AsFrontChange converts a Switch to a FrontChange protobuf.
+func (s Switch) AsFrontChange() *pb.FrontChange {
+ return &pb.FrontChange{
+ Member: s.Member.AsProto(),
+ Switch: s.AsProto(),
+ }
+}
diff --git a/cmd/mi/server.go b/cmd/mi/server.go
new file mode 100644
index 0000000..ff43de1
--- /dev/null
+++ b/cmd/mi/server.go
@@ -0,0 +1,126 @@
+package main
+
+import (
+ "context"
+ "time"
+
+ "github.com/oklog/ulid/v2"
+ "github.com/twitchtv/twirp"
+ "google.golang.org/protobuf/types/known/emptypb"
+ "gorm.io/gorm"
+ "within.website/x/cmd/mi/models"
+ pb "within.website/x/proto/mi"
+)
+
+func p[T any](v T) *T {
+ return &v
+}
+
+type SwitchTracker struct {
+ db *gorm.DB
+}
+
+func NewSwitchTracker(db *gorm.DB) *SwitchTracker {
+ return &SwitchTracker{db: db}
+}
+
+func (s *SwitchTracker) Members(ctx context.Context, _ *emptypb.Empty) (*pb.MembersResp, error) {
+ var members []models.Member
+ if err := s.db.Find(&members).Error; err != nil {
+ return nil, err
+ }
+
+ var resp pb.MembersResp
+ for _, m := range members {
+ resp.Members = append(resp.Members, m.AsProto())
+ }
+
+ return &resp, nil
+}
+
+func (s *SwitchTracker) WhoIsFront(ctx context.Context, _ *emptypb.Empty) (*pb.FrontChange, error) {
+ var sw models.Switch
+ if err := s.db.Joins("Member").Order("created_at DESC").First(&sw).Error; err != nil {
+ return nil, twirp.InternalErrorWith(err)
+ }
+
+ return sw.AsFrontChange(), nil
+}
+
+func (s *SwitchTracker) Switch(ctx context.Context, req *pb.SwitchReq) (*pb.SwitchResp, error) {
+ var sw models.Switch
+
+ tx := s.db.Begin()
+
+ if err := tx.Joins("Member").Where("ended_at IS NULL").First(&sw).Error; err != nil {
+ tx.Rollback()
+ return nil, twirp.InternalErrorf("failed to find current switch: %w", err)
+ }
+
+ if sw.Member.Name == req.MemberName {
+ tx.Rollback()
+ return nil, twirp.InvalidArgumentError("member_name", "cannot switch to the same member").
+ WithMeta("member_name", req.MemberName).
+ WithMeta("current_member", sw.Member.Name)
+ }
+
+ sw.EndedAt = p(time.Now())
+ if err := tx.Save(&sw).Error; err != nil {
+ tx.Rollback()
+ return nil, twirp.InternalErrorf("failed to save current switch: %w", err)
+ }
+
+ var newMember models.Member
+ if err := tx.Where("name = ?", req.MemberName).First(&newMember).Error; err != nil {
+ tx.Rollback()
+ return nil, twirp.NotFoundError("member not found").WithMeta("member_name", req.MemberName)
+ }
+
+ newSwitch := models.Switch{
+ ID: ulid.MustNew(ulid.Now(), nil).String(),
+ MemberID: newMember.ID,
+ }
+
+ if err := tx.Create(&newSwitch).Error; err != nil {
+ tx.Rollback()
+ return nil, twirp.InternalErrorf("failed to create new switch: %w", err)
+ }
+
+ if err := tx.Commit().Error; err != nil {
+ return nil, twirp.InternalErrorf("failed to commit transaction: %w", err)
+ }
+
+ return &pb.SwitchResp{
+ Old: sw.AsProto(),
+ Current: newSwitch.AsProto(),
+ }, nil
+}
+
+func (s *SwitchTracker) GetSwitch(ctx context.Context, req *pb.GetSwitchReq) (*pb.FrontChange, error) {
+ var sw models.Switch
+ if err := s.db.Joins("Member").Where("id = ?", req.Id).First(&sw).Error; err != nil {
+ return nil, twirp.NotFoundError("switch not found").WithMeta("id", req.Id)
+ }
+
+ return sw.AsFrontChange(), nil
+}
+
+func (s *SwitchTracker) ListSwitches(ctx context.Context, req *pb.ListSwitchesReq) (*pb.ListSwitchesResp, error) {
+ var switches []models.Switch
+
+ if req.GetCount() == 0 {
+ req.Count = 30
+ }
+
+ if err := s.db.Joins("Member").Order("rowid DESC").Limit(int(req.GetCount())).Offset(int(req.GetCount() * req.GetPage())).Find(&switches).Error; err != nil {
+ return nil, err
+ }
+
+ var resp pb.ListSwitchesResp
+
+ for _, sw := range switches {
+ resp.Switches = append(resp.Switches, sw.AsFrontChange())
+ }
+
+ return &resp, nil
+}
diff --git a/cmd/mi/testdata/members.json b/cmd/mi/testdata/members.json
new file mode 100644
index 0000000..cecc2b0
--- /dev/null
+++ b/cmd/mi/testdata/members.json
@@ -0,0 +1,32 @@
+[
+ {
+ "id": 0,
+ "name": "Cadey",
+ "avatar_url": "https://mi.within.website/static/img/cadey.png"
+ },
+ {
+ "id": 1,
+ "name": "Nicole",
+ "avatar_url": "https://mi.within.website/static/img/nicole.png"
+ },
+ {
+ "id": 2,
+ "name": "Jessie",
+ "avatar_url": "https://mi.within.website/static/img/jessie.png"
+ },
+ {
+ "id": 3,
+ "name": "Ashe",
+ "avatar_url": "https://mi.within.website/static/img/ashe.png"
+ },
+ {
+ "id": 4,
+ "name": "Sephie",
+ "avatar_url": "https://mi.within.website/static/img/sephie.png"
+ },
+ {
+ "id": 5,
+ "name": "Mai",
+ "avatar_url": "https://mi.within.website/static/img/mai.png"
+ }
+] \ No newline at end of file
diff --git a/cmd/mi/var/.gitignore b/cmd/mi/var/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/cmd/mi/var/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/flake.nix b/flake.nix
index 1711daa..0aa7498 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,4 +1,4 @@
-# nix-direnv cache busting line: sha256-2L8g1D0eqC8vLqoytxL8gmMxOrv2+9veJx+NQv5oI4M=
+# nix-direnv cache busting line: sha256-NOymNGq2Ea1DWMs/8L30tAEzqSvZcp7TvxV4a8tnuGM=
{
description = "/x/perimental code";
@@ -85,6 +85,13 @@
];
};
+ mi = pkgs.buildGo122Module {
+ pname = "mi";
+ inherit version vendorHash;
+ src = ./.;
+ subPackages = [ "cmd/mi" ];
+ };
+
mimi = pkgs.buildGo122Module {
pname = "mimi";
inherit version vendorHash;
@@ -230,7 +237,7 @@
path = "make-mastodon-app";
};
- inherit xedn xedn-static robocadey2 mimi tourian sapientwindex;
+ inherit xedn xedn-static robocadey2 mimi mi tourian sapientwindex;
aegis = copyFile { pname = "aegis"; };
cadeybot = copyFile { pname = "cadeybot"; };
@@ -252,6 +259,7 @@
docker = let
robocadey2 = self.packages.${system}.robocadey2;
xedn = self.packages.${system}.xedn;
+ mi = self.packages.${system}.mi;
mimi = self.packages.${system}.mimi;
sapientwindex = self.packages.${system}.sapientwindex;
tourian = self.packages.${system}.tourian;
@@ -266,8 +274,13 @@
};
};
in {
+ mi = simple {
+ name = "ghcr.io/xe/x/mi";
+ pkg = mi;
+ cmd = ["${mi}/bin/mi"];
+ };
sapientwindex = simple {
- name = "ghcr.io/Xe/x/sapientwindex";
+ name = "ghcr.io/xe/x/sapientwindex";
pkg = sapientwindex;
cmd = ["${sapientwindex}/bin/sapientwindex"];
};
diff --git a/go.mod b/go.mod
index 4fb75a8..df11f41 100644
--- a/go.mod
+++ b/go.mod
@@ -119,17 +119,21 @@ require (
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
+ github.com/jinzhu/inflection v1.0.0 // indirect
+ github.com/jinzhu/now v1.1.5 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
+ github.com/orandin/slog-gorm v1.3.2 // indirect
github.com/pires/go-proxyproto v0.7.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
@@ -159,6 +163,8 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
+ gorm.io/driver/sqlite v1.5.5 // indirect
+ gorm.io/gorm v1.25.10 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.41.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
diff --git a/go.sum b/go.sum
index 1c5369a..b6a3aee 100644
--- a/go.sum
+++ b/go.sum
@@ -530,6 +530,10 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellydator/ttlcache/v3 v3.1.0 h1:0gPFG0IHHP6xyUyXq+JaD8fwkDCqgqwohXNJBcYE71g=
github.com/jellydator/ttlcache/v3 v3.1.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
+github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@@ -646,6 +650,8 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
+github.com/orandin/slog-gorm v1.3.2 h1:C0lKDQPAx/pF+8K2HL7bdShPwOEJpPM0Bn80zTzxU1g=
+github.com/orandin/slog-gorm v1.3.2/go.mod h1:MoZ51+b7xE9lwGNPYEhxcUtRNrYzjdcKvA8QXQQGEPA=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
@@ -1405,6 +1411,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E=
+gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE=
+gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s=
+gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
gvisor.dev/gvisor v0.0.0-20240306221502-ee1e1f6070e3 h1:/8/t5pz/mgdRXhYOIeqqYhFAQLE4DDGegc0Y4ZjyFJM=
gvisor.dev/gvisor v0.0.0-20240306221502-ee1e1f6070e3/go.mod h1:NQHVAzMwvZ+Qe3ElSiHmq9RUm1MdNHpUZ52fiEqvn+0=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/proto/mi.proto b/proto/mi.proto
index cb236ad..75422ba 100644
--- a/proto/mi.proto
+++ b/proto/mi.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
package within.website.x.mi;
-option go_package = "within.website/x/cmd/mi/pb";
+option go_package = "within.website/x/proto/mi";
import "google/protobuf/empty.proto";
@@ -24,7 +24,7 @@ message Member {
message Switch {
string id = 1; // required
- string member_id = 2; // required
+ int32 member_id = 2; // required
string started_at = 3; // RFC 3339, required
string ended_at = 4; // RFC 3339, optional if switch is current
}
@@ -52,7 +52,7 @@ message ListSwitchesReq {
int32 page = 2; // required
}
-message ListSwitchesResp { repeated Switch switches = 1; }
+message ListSwitchesResp { repeated FrontChange switches = 1; }
service POSSE {
rpc RefreshBlog(google.protobuf.Empty) returns (google.protobuf.Empty);
diff --git a/proto/mi/mi.pb.go b/proto/mi/mi.pb.go
index 338b429..bcbb3c6 100644
--- a/proto/mi/mi.pb.go
+++ b/proto/mi/mi.pb.go
@@ -4,7 +4,7 @@
// protoc v4.25.3
// source: mi.proto
-package pb
+package mi
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -137,7 +137,7 @@ type Switch struct {
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // required
- MemberId string `protobuf:"bytes,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` // required
+ MemberId int32 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` // required
StartedAt string `protobuf:"bytes,3,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` // RFC 3339, required
EndedAt string `protobuf:"bytes,4,opt,name=ended_at,json=endedAt,proto3" json:"ended_at,omitempty"` // RFC 3339, optional if switch is current
}
@@ -181,11 +181,11 @@ func (x *Switch) GetId() string {
return ""
}
-func (x *Switch) GetMemberId() string {
+func (x *Switch) GetMemberId() int32 {
if x != nil {
return x.MemberId
}
- return ""
+ return 0
}
func (x *Switch) GetStartedAt() string {
@@ -466,7 +466,7 @@ type ListSwitchesResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Switches []*Switch `protobuf:"bytes,1,rep,name=switches,proto3" json:"switches,omitempty"`
+ Switches []*FrontChange `protobuf:"bytes,1,rep,name=switches,proto3" json:"switches,omitempty"`
}
func (x *ListSwitchesResp) Reset() {
@@ -501,7 +501,7 @@ func (*ListSwitchesResp) Descriptor() ([]byte, []int) {
return file_mi_proto_rawDescGZIP(), []int{8}
}
-func (x *ListSwitchesResp) GetSwitches() []*Switch {
+func (x *ListSwitchesResp) GetSwitches() []*FrontChange {
if x != nil {
return x.Switches
}
@@ -526,7 +526,7 @@ var file_mi_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22,
0x6f, 0x0a, 0x06, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d,
- 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65,
+ 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x65,
0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65,
0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72,
0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x61,
@@ -554,44 +554,44 @@ var file_mi_proto_rawDesc = []byte{
0x69, 0x73, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x4b, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74,
- 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08,
- 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b,
- 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e,
- 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x08, 0x73, 0x77, 0x69,
- 0x74, 0x63, 0x68, 0x65, 0x73, 0x32, 0x96, 0x03, 0x0a, 0x0d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
- 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x07, 0x4d, 0x65, 0x6d, 0x62, 0x65,
- 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x77, 0x69, 0x74,
- 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69,
- 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0a,
- 0x57, 0x68, 0x6f, 0x49, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
- 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73,
- 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x43, 0x68,
- 0x61, 0x6e, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x1e,
+ 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x50, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74,
+ 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x08,
+ 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20,
0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e,
- 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x1f,
- 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e,
- 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12,
- 0x50, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x21, 0x2e, 0x77,
- 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e,
- 0x6d, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x1a,
+ 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
+ 0x52, 0x08, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x32, 0x96, 0x03, 0x0a, 0x0d, 0x53,
+ 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x07,
+ 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x20, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65,
- 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67,
- 0x65, 0x12, 0x5b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65,
- 0x73, 0x12, 0x24, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69,
- 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x69, 0x74,
- 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e,
- 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0x46,
- 0x0a, 0x05, 0x50, 0x4f, 0x53, 0x53, 0x45, 0x12, 0x3d, 0x0a, 0x0b, 0x52, 0x65, 0x66, 0x72, 0x65,
- 0x73, 0x68, 0x42, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1c, 0x5a, 0x1a, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e,
- 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x78, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x6d,
- 0x69, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x12, 0x46, 0x0a, 0x0a, 0x57, 0x68, 0x6f, 0x49, 0x73, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x12,
+ 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e,
+ 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x46, 0x72,
+ 0x6f, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x53, 0x77, 0x69,
+ 0x74, 0x63, 0x68, 0x12, 0x1e, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62,
+ 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62,
+ 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x52, 0x65, 0x73, 0x70, 0x12, 0x50, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x12, 0x21, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69,
+ 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65,
+ 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74,
+ 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77,
+ 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e,
+ 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x4c, 0x69, 0x73,
+ 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x77,
+ 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e,
+ 0x6d, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x32, 0x46, 0x0a, 0x05, 0x50, 0x4f, 0x53, 0x53, 0x45, 0x12, 0x3d, 0x0a, 0x0b,
+ 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x42, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
+ 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1b, 0x5a, 0x19, 0x77,
+ 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x78, 0x2f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -625,7 +625,7 @@ var file_mi_proto_depIdxs = []int32{
2, // 2: within.website.x.mi.SwitchResp.current:type_name -> within.website.x.mi.Switch
2, // 3: within.website.x.mi.FrontChange.switch:type_name -> within.website.x.mi.Switch
1, // 4: within.website.x.mi.FrontChange.member:type_name -> within.website.x.mi.Member
- 2, // 5: within.website.x.mi.ListSwitchesResp.switches:type_name -> within.website.x.mi.Switch
+ 6, // 5: within.website.x.mi.ListSwitchesResp.switches:type_name -> within.website.x.mi.FrontChange
9, // 6: within.website.x.mi.SwitchTracker.Members:input_type -> google.protobuf.Empty
9, // 7: within.website.x.mi.SwitchTracker.WhoIsFront:input_type -> google.protobuf.Empty
3, // 8: within.website.x.mi.SwitchTracker.Switch:input_type -> within.website.x.mi.SwitchReq
diff --git a/proto/mi/mi.twirp.go b/proto/mi/mi.twirp.go
index 2414ee4..7d91e36 100644
--- a/proto/mi/mi.twirp.go
+++ b/proto/mi/mi.twirp.go
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT.
// source: mi.proto
-package pb
+package mi
import context "context"
import fmt "fmt"
@@ -2699,39 +2699,39 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error)
}
var twirpFileDescriptor0 = []byte{
- // 533 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x5d, 0x6f, 0xd3, 0x30,
- 0x14, 0x55, 0xd7, 0xf5, 0x23, 0xb7, 0xe3, 0x43, 0x06, 0xa1, 0xd2, 0xc2, 0x56, 0x22, 0x90, 0xfa,
- 0x00, 0x89, 0xd4, 0x09, 0xf1, 0x80, 0x78, 0xd8, 0xc6, 0x8a, 0xaa, 0xf1, 0x31, 0xa5, 0x20, 0x24,
- 0x78, 0xa8, 0xdc, 0xe6, 0xae, 0xb5, 0x48, 0xe2, 0xcc, 0x76, 0xe9, 0xf8, 0x23, 0xfc, 0x5e, 0x14,
- 0xdb, 0x29, 0xdd, 0xd4, 0x86, 0xf2, 0x66, 0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, 0x17, 0x6a, 0x11,
+ 0xf3, 0x12, 0xc1, 0x15, 0x27, 0x0f, 0x96, 0x4c, 0xcd, 0x59, 0xec, 0x2d, 0x71, 0x22, 0x99, 0x42,
+ 0xef, 0xca, 0x8b, 0x58, 0xb3, 0x35, 0xe3, 0x7c, 0x16, 0x62, 0x57, 0x43, 0x26, 0x8b, 0x8b, 0x2e,
+ 0x46, 0x89, 0xfa, 0x6d, 0x32, 0xdc, 0xb7, 0x50, 0xff, 0x88, 0xd1, 0x04, 0x85, 0xf4, 0x51, 0x26,
+ 0xe4, 0x25, 0x54, 0x23, 0x63, 0x36, 0x0a, 0xed, 0x52, 0xa7, 0xde, 0x6b, 0x79, 0x6b, 0x28, 0x3d,
+ 0x93, 0xe2, 0x6