Files
scrabble-game/pkg/fbs/scrabblefb/MoveRecord.go
T
Ilia Denisov 408da3f201
Tests · Go / test (push) Successful in 8s
Tests · Integration / integration (push) Successful in 11s
Tests · Go / test (pull_request) Successful in 6s
Tests · Integration / integration (pull_request) Successful in 10s
Stage 6: gateway edge (Connect/FlatBuffers over h2c, platform/email/guest auth, sessions, rate-limit, admin passthrough, live push bridge)
New public ingress and the first network edge. Framework + a vertical slice of
operations end-to-end; remaining ops reuse the same transcode pattern in Stage 7.

Contracts (new module scrabble/pkg):
- push.proto (backend->gateway gRPC server-stream) + scrabble.fbs (FlatBuffers
  edge payloads), committed generated Go; buf/flatc Makefiles (dev-time codegen).

Backend:
- REST handlers on the /api/v1 groups: internal session endpoints
  (telegram/guest/email login -> mint, resolve, revoke) and the user slice
  (profile, submit_play, state, lobby enqueue/poll, chat).
- internal/notify in-process Publisher hub + internal/pushgrpc gRPC server
  (BACKEND_GRPC_ADDR) streaming your_turn/opponent_moved/chat/nudge/match_found;
  emission in game.commit, social, matchmaker.
- migration 00005 accounts.is_guest; guests are durable rows excluded from stats;
  ProvisionGuest; email-as-login (RequestLoginCode/LoginWithCode).

Gateway (new module scrabble/gateway):
- Connect Gateway service over h2c (Execute + Subscribe), FlatBuffers<->JSON
  transcode registry, Telegram initData HMAC validator (seam), session cache,
  token-bucket rate limiter (3 classes), push fan-out hub, backend REST + push
  gRPC client, admin Basic-Auth reverse proxy.

go.work: use ./pkg, ./gateway + replace scrabble/pkg. CI: gateway/**, pkg/**
path filters; unit build/vet/test span all three modules. Docs (PLAN,
ARCHITECTURE, FUNCTIONAL+ru, TESTING, READMEs) updated; gateway/pkg unit tests +
guest/email-login integration tests.
2026-06-02 22:38:24 +02:00

211 lines
5.3 KiB
Go

// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package scrabblefb
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type MoveRecord struct {
_tab flatbuffers.Table
}
func GetRootAsMoveRecord(buf []byte, offset flatbuffers.UOffsetT) *MoveRecord {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &MoveRecord{}
x.Init(buf, n+offset)
return x
}
func FinishMoveRecordBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
builder.Finish(offset)
}
func GetSizePrefixedRootAsMoveRecord(buf []byte, offset flatbuffers.UOffsetT) *MoveRecord {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &MoveRecord{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func FinishSizePrefixedMoveRecordBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
builder.FinishSizePrefixed(offset)
}
func (rcv *MoveRecord) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *MoveRecord) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *MoveRecord) Player() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutatePlayer(n int32) bool {
return rcv._tab.MutateInt32Slot(4, n)
}
func (rcv *MoveRecord) Action() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *MoveRecord) Dir() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *MoveRecord) MainRow() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutateMainRow(n int32) bool {
return rcv._tab.MutateInt32Slot(10, n)
}
func (rcv *MoveRecord) MainCol() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutateMainCol(n int32) bool {
return rcv._tab.MutateInt32Slot(12, n)
}
func (rcv *MoveRecord) Tiles(obj *TileRecord, j int) bool {
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
if o != 0 {
x := rcv._tab.Vector(o)
x += flatbuffers.UOffsetT(j) * 4
x = rcv._tab.Indirect(x)
obj.Init(rcv._tab.Bytes, x)
return true
}
return false
}
func (rcv *MoveRecord) TilesLength() int {
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
if o != 0 {
return rcv._tab.VectorLen(o)
}
return 0
}
func (rcv *MoveRecord) Words(j int) []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
if o != 0 {
a := rcv._tab.Vector(o)
return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4))
}
return nil
}
func (rcv *MoveRecord) WordsLength() int {
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
if o != 0 {
return rcv._tab.VectorLen(o)
}
return 0
}
func (rcv *MoveRecord) Count() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutateCount(n int32) bool {
return rcv._tab.MutateInt32Slot(18, n)
}
func (rcv *MoveRecord) Score() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutateScore(n int32) bool {
return rcv._tab.MutateInt32Slot(20, n)
}
func (rcv *MoveRecord) Total() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(22))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *MoveRecord) MutateTotal(n int32) bool {
return rcv._tab.MutateInt32Slot(22, n)
}
func MoveRecordStart(builder *flatbuffers.Builder) {
builder.StartObject(10)
}
func MoveRecordAddPlayer(builder *flatbuffers.Builder, player int32) {
builder.PrependInt32Slot(0, player, 0)
}
func MoveRecordAddAction(builder *flatbuffers.Builder, action flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(action), 0)
}
func MoveRecordAddDir(builder *flatbuffers.Builder, dir flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(dir), 0)
}
func MoveRecordAddMainRow(builder *flatbuffers.Builder, mainRow int32) {
builder.PrependInt32Slot(3, mainRow, 0)
}
func MoveRecordAddMainCol(builder *flatbuffers.Builder, mainCol int32) {
builder.PrependInt32Slot(4, mainCol, 0)
}
func MoveRecordAddTiles(builder *flatbuffers.Builder, tiles flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(tiles), 0)
}
func MoveRecordStartTilesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
return builder.StartVector(4, numElems, 4)
}
func MoveRecordAddWords(builder *flatbuffers.Builder, words flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(words), 0)
}
func MoveRecordStartWordsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
return builder.StartVector(4, numElems, 4)
}
func MoveRecordAddCount(builder *flatbuffers.Builder, count int32) {
builder.PrependInt32Slot(7, count, 0)
}
func MoveRecordAddScore(builder *flatbuffers.Builder, score int32) {
builder.PrependInt32Slot(8, score, 0)
}
func MoveRecordAddTotal(builder *flatbuffers.Builder, total int32) {
builder.PrependInt32Slot(9, total, 0)
}
func MoveRecordEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}