diff --git a/Makefile b/Makefile index ef6e69f..e775b6c 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,21 @@ +all: avro flatbuffers protobuf + avro: twt-avro/gen.go twt-avro/gen.go: lextwt.avro go tool avro gen -pkg twt_avro -encoders lextwt.avro > twt-avro/gen.go -flatbuffers: twt-fbs/gen.go -twt-fbs/gen.go: lextwt.fbs +flatbuffers: twt-fbs/lextwt +twt-fbs/lextwt: lextwt.fbs flatc -o twt-fbs --go lextwt.fbs -.ALL: avro flatbuffers \ No newline at end of file +protobuf: twt-pb/lextwt.pb.go +twt-pb/lextwt.pb.go: lextwt.proto + protoc --proto_path=. \ + --plugin=bin/protoc-gen-go \ + --go_opt=paths=source_relative \ + --go_opt="Mlextwt.proto=go.sour.is/lextwt-encoding/twt-pb;twt_pb" \ + --go_out=twt-pb \ + lextwt.proto + +.PHONY: avro protobuf flatbuffers \ No newline at end of file diff --git a/bin/protoc-gen-go b/bin/protoc-gen-go new file mode 100755 index 0000000..8215f08 --- /dev/null +++ b/bin/protoc-gen-go @@ -0,0 +1,2 @@ +#!/bin/sh +go tool protoc-gen-go $@ diff --git a/go.mod b/go.mod index 829d2e1..1b1666e 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module go.sour.is/lextwt-encoding go 1.24.0 tool ( + github.com/SpirentOrion/go-avrogrpc/go-avrogrpc github.com/Zxilly/go-size-analyzer/cmd/gsa github.com/hamba/avro/v2/cmd/avrogen github.com/hamba/avro/v2/cmd/avrosv @@ -12,11 +13,14 @@ tool ( require github.com/hamba/avro/v2 v2.28.0 require ( + github.com/SpirentOrion/go-avrogrpc v0.0.0-20201103153720-fba312c1a9f5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/ettle/strcase v0.2.0 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/linkedin/goavro/v2 v2.9.8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/writeas/go-strip-markdown/v2 v2.1.1 // indirect diff --git a/go.sum b/go.sum index cf54a51..761893c 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,7 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/SpirentOrion/go-avrogrpc v0.0.0-20201103153720-fba312c1a9f5 h1:PsBRyCMJTgg3sbFY45O8IpUxnau4s6FMLraOuyeWJNw= +github.com/SpirentOrion/go-avrogrpc v0.0.0-20201103153720-fba312c1a9f5/go.mod h1:kIndDKhG+QcIc1PU9oaT7S6BqIRNyMzvQskKj66EpKQ= github.com/Zxilly/go-size-analyzer v1.7.7 h1:z+OwZgSENyR5EYh2Oce3qvDgC/ghEIwL2cf86ilKkJA= github.com/Zxilly/go-size-analyzer v1.7.7/go.mod h1:zanxPHgC5cVqi9D2l3X6Up9cfSePAVFUn8Bnoixf05Y= github.com/ZxillyFork/gore v0.0.0-20250212071411-56f1a74740b2 h1:2H4tzbdntoU7JdP096mOIIk/nLoDF+V1xOCvI5JmBic= @@ -14,6 +18,7 @@ github.com/blacktop/go-dwarf v1.0.10 h1:i9zYgcIROETsNZ6V+zZn3uDH21FCG5BLLZ837Git github.com/blacktop/go-dwarf v1.0.10/go.mod h1:4W2FKgSFYcZLDwnR7k+apv5i3nrau4NGl9N6VQ9DSTo= github.com/blacktop/go-macho v1.1.238 h1:OFfT6NB/SWxkoky7L/ytuY8QekgFpa9pmz/GHUQLsmM= github.com/blacktop/go-macho v1.1.238/go.mod h1:dtlW2AJKQpFzImBVPWiUKZ6OxrQ2MLfWi/BPPe0EONE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE= github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU= github.com/charmbracelet/bubbletea v1.3.3 h1:WpU6fCY0J2vDWM3zfS3vIDi/ULq3SYphZhkAGGvmEUY= @@ -24,11 +29,16 @@ github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2ll github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= @@ -37,12 +47,23 @@ github.com/go-delve/delve v1.24.0 h1:M1auuI7kyfXZm5LMDQEqhqr4koKWOzGKhCgwMxsLQfo github.com/go-delve/delve v1.24.0/go.mod h1:yNWXOuo4yslMOOj7O8gIRrf/trDBrFy5ZXwJL4ZzOos= github.com/go-json-experiment/json v0.0.0-20250213060926-925ba3f173fa h1:Rpu6sKAzIeSWBkrFHD52g8yipagcPbY2Lmm70NL1Gzc= github.com/go-json-experiment/json v0.0.0-20250213060926-925ba3f173fa/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hamba/avro v1.8.0 h1:eCVrLX7UYThA3R3yBZ+rpmafA5qTc3ZjpTz6gYJoVGU= github.com/hamba/avro v1.8.0/go.mod h1:NiGUcrLLT+CKfGu5REWQtD9OVPPYUGMVFiC+DE0lQfY= github.com/hamba/avro/v2 v2.28.0 h1:E8J5D27biyAulWKNiEBhV85QPc9xRMCUCGJewS0KYCE= @@ -58,6 +79,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/knadh/profiler v0.2.0 h1:jaY0xlQs8iaWxKdvGHOftaZnX7d8l7yrCGQPSecwnng= github.com/knadh/profiler v0.2.0/go.mod h1:LqNkAu++MfFkbEDA63AmRaIf6UkGrLXyZ5VQQdekZiI= +github.com/linkedin/goavro/v2 v2.9.8 h1:jN50elxBsGBDGVDEKqUlDuU1cFwJ11K/yrJCBMe/7Wg= +github.com/linkedin/goavro/v2 v2.9.8/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -90,6 +113,7 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -100,6 +124,7 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= @@ -116,31 +141,61 @@ go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede h1:XV9tuDQ605xxH4qIQPRHM go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede/go.mod h1:+xnDkQ0T0S8emxWIsvxlCAoyF8gBaj0q81hr/VrKc0c= golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4= golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo7yrN4mVcnkHDYz5vvs= golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/lextwt-encoding b/lextwt-encoding new file mode 100755 index 0000000..b0ebc8e Binary files /dev/null and b/lextwt-encoding differ diff --git a/lextwt.proto b/lextwt.proto index d9462cf..177530b 100644 --- a/lextwt.proto +++ b/lextwt.proto @@ -1 +1,104 @@ +syntax = "proto3"; option go_package = "go.sour.is/lextwt-proto/pb"; + + +service TwtRegistryService { + rpc latestTwts (LatestTwts) returns (TwtRegistry); +} + +message LatestTwts {} + +message TwtRegistry { + repeated Comment preamble = 1; + repeated Twter twters = 2; + repeated Twt twts = 3; +} + +message BangMention { + string name = 1; + string target = 2; +} + +message Code { + enum Type { + CODE_UNSPECIFIED = 0; + CODE_INLINE = 1; + CODE_BLOCK = 2; + } + + Type type = 1; + string code = 2; +} + +message Comment { + string comment = 1; + string key = 2; + string value = 3; +} + +message DateTime { + int64 timestamp = 1; + int32 offset = 2; + string zone = 3; +} + +message LineSeparator {} + +message Link { + enum Type { + LINK_UNSPECIFIED = 0; + LINK_STANDARD = 1; + LINK_MEDIA = 2; + LINK_PLAIN = 3; + LINK_NAKED = 4; + } + + Type type = 1; + string alt = 2; + string target = 3; + string title = 4; +} + +message Mention { + string name = 1; + string target = 2; +} + +message Subject { + string subject = 1; + Tag tag = 2; +} + +message Tag { + string tag = 1; + string target = 2; +} + +message Text { + string text = 1; +} + +message Twter { + string nick = 1; + string uri = 2; +} + +message Elem { + oneof elem { + BangMention bangmention = 1; + Code code = 2; + Comment comment = 3; + LineSeparator lineseparator = 4; + Link link = 5; + Mention mention = 6; + Subject subject = 7; + Tag tag = 8; + Text text = 9; + }; +} + +message Twt { + Twter twter = 1; + DateTime created = 2; + repeated Elem msg = 3; +} diff --git a/main.go b/main.go index 8e9108e..e9a91cc 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( twt_avro "go.sour.is/lextwt-encoding/twt-avro" twt_fbs "go.sour.is/lextwt-encoding/twt-fbs" + twt_pb "go.sour.is/lextwt-encoding/twt-pb" ) type TwtRegistry interface { @@ -54,6 +55,12 @@ func main() { if err == nil { registry, err = twt_avro.DecodeRegistry(b) } + case "pb": + var b []byte + b, err = io.ReadAll(in) + if err == nil { + registry, err = twt_pb.DecodeRegistry(b) + } default: log(fmt.Errorf("unknown input format: %q", inputType)) return @@ -84,6 +91,15 @@ func main() { if err != nil { log(err) } + case "pb": + b, err := twt_pb.EncodeRegistry(registry) + if err != nil { + log(err) + } + _, err = out.Write(b) + if err != nil { + log(err) + } default: log(fmt.Errorf("unknown output format: %q", outputType)) diff --git a/twt-pb/helper.go b/twt-pb/helper.go new file mode 100644 index 0000000..aebdf92 --- /dev/null +++ b/twt-pb/helper.go @@ -0,0 +1,310 @@ +package twt_pb + +import ( + "io" + "iter" + "slices" + "time" + + "go.yarn.social/lextwt" + "go.yarn.social/types" + "google.golang.org/protobuf/proto" +) + +type twtRegistry interface { + Twters() []*types.Twter + Preamble() lextwt.Comments + Twts() types.Twts + WriteTo(w io.Writer) (int64, error) +} + +func EncodeRegistry(r twtRegistry) ([]byte, error) { + o := &TwtRegistry{} + o.FromLextwt(r) + + return proto.Marshal(o) +} +func DecodeRegistry(b []byte) (twtRegistry, error) { + o := &TwtRegistry{} + err := proto.Unmarshal(b, o) + if err != nil { + return nil, err + } + return o.ToLextwt(), nil +} + +func (r *TwtRegistry) FromLextwt(twt twtRegistry) error { + twters := twt.Twters() + r.Twters = apply( + slices.All(twters), + make([]*Twter, len(twters)), + fromTwter) + + preamble := twt.Preamble() + r.Preamble = apply( + slices.All(preamble), + make([]*Comment, len(preamble)), + fromComment) + + twts := twt.Twts() + r.Twts = apply( + slices.All(twts), + make([]*Twt, len(twts)), + fromTwt) + + return nil +} +func (r *TwtRegistry) ToLextwt() twtRegistry { + return lextwt.NewTwtRegistry( + apply(slices.All(r.Twters), make([]*types.Twter, len(r.Twters)), func(c *Twter) *types.Twter { + return c.ToLextwt() + }), + apply(slices.All(r.Preamble), make(lextwt.Comments, len(r.Preamble)), func(c *Comment) *lextwt.Comment { + return c.ToLextwt() + }), + apply(slices.All(r.Twts), make(types.Twts, len(r.Twts)), func(c *Twt) types.Twt { + return c.ToLextwt() + }), + ) +} + +func apply[U, V any](u iter.Seq2[int, U], v []V, fn func(U) V) []V { + for i, u := range u { + v[i] = fn(u) + } + return v + +} + +func (e *Twter) FromLextwt(twt *types.Twter) { + e.Nick = twt.Nick + e.Uri = twt.URI +} +func fromTwter(twt *types.Twter) *Twter { + return &Twter{ + Nick: twt.Nick, + Uri: twt.URI, + } +} +func (e *Twter) ToLextwt() *types.Twter { + return &types.Twter{ + Nick: e.Nick, + URI: e.Uri, + } +} + +func (e *Twt) FromLextwt(twt *lextwt.Twt) { + twter := twt.Twter() + + e.Twter.FromLextwt(&twter) + e.Created = fromDateTime(twt.Created()) + e.Msg = apply( + slices.All(twt.Elems()), + make([]*Elem, len(twt.Elems())), + fromElem, + ) +} +func fromTwt(twt types.Twt) *Twt { + twter := twt.Twter() + lx, ok := twt.(*lextwt.Twt) + if !ok { + return &Twt{} + } + + msg := lx.Elems() + return &Twt{ + Twter: fromTwter(&twter), + Created: fromDateTime(twt.Created()), + Msg: apply( + slices.All(msg), + make([]*Elem, len(msg)), + fromElem, + ), + } +} +func (e *Twt) ToLextwt() *lextwt.Twt { + return lextwt.NewTwt( + *e.Twter.ToLextwt(), + e.Created.ToLextwt(), + apply( + slices.All(e.Msg), + make([]lextwt.Elem, len(e.Msg)), + func(e *Elem) lextwt.Elem { + return e.ToLextwt() + }, + )..., + ) +} + +func fromDateTime(t time.Time) *DateTime { + zone, offset := t.Zone() + return &DateTime{ + Timestamp: t.UnixMicro(), + Offset: int32(offset), + Zone: zone, + } +} +func (c *DateTime) ToLextwt() *lextwt.DateTime { + dt := time.UnixMicro(c.Timestamp) + dt = dt.In(time.FixedZone(c.Zone, int(c.Offset))) + return lextwt.NewDateTime(dt, dt.Format(time.RFC3339)) +} + +func fromElem(e lextwt.Elem) *Elem { + if e == lextwt.LineSeparator { + return &Elem{Elem: &Elem_Lineseparator{fromLineSeparator()}} + } + + switch e := e.(type) { + case *lextwt.BangMention: + return &Elem{Elem: &Elem_Bangmention{fromBangMention(e)}} + + case *lextwt.Code: + return &Elem{Elem: &Elem_Code{fromCode(e)}} + + case *lextwt.Comment: + return &Elem{Elem: &Elem_Comment{fromComment(e)}} + + case *lextwt.Mention: + return &Elem{Elem: &Elem_Mention{fromMention(e)}} + + case *lextwt.Subject: + return &Elem{Elem: &Elem_Subject{fromSubject(e)}} + + case *lextwt.Tag: + return &Elem{Elem: &Elem_Tag{fromTag(e)}} + + case *lextwt.Link: + return &Elem{Elem: &Elem_Link{fromLink(e)}} + + case *lextwt.Text: + return &Elem{Elem: &Elem_Text{fromText(e)}} + } + + return &Elem{} +} +func (c *Elem) ToLextwt() lextwt.Elem { + switch e := c.Elem.(type) { + case *Elem_Bangmention: + return e.Bangmention.ToLextwt() + case *Elem_Code: + return e.Code.ToLextwt() + case *Elem_Comment: + return e.Comment.ToLextwt() + case *Elem_Lineseparator: + return e.Lineseparator.ToLextwt() + case *Elem_Link: + return e.Link.ToLextwt() + case *Elem_Mention: + return e.Mention.ToLextwt() + case *Elem_Subject: + return e.Subject.ToLextwt() + case *Elem_Tag: + return e.Tag.ToLextwt() + case *Elem_Text: + return e.Text.ToLextwt() + } + return nil +} + +func fromCode(c *lextwt.Code) *Code { + return &Code{ + Type: Code_Type(c.CodeType()), + Code: c.Text(), + } +} +func (c *Code) ToLextwt() *lextwt.Code { + return lextwt.NewCode(c.Code, lextwt.CodeType(c.Type)) +} + +func fromComment(c *lextwt.Comment) *Comment { + return &Comment{ + Comment: c.Text(), + Key: c.Key(), + Value: c.Value(), + } +} +func (c *Comment) ToLextwt() *lextwt.Comment { + if c.Key != "" { + return lextwt.NewCommentValue(c.Comment, c.Key, c.Value) + } + return lextwt.NewComment(c.Comment) +} + +func fromBangMention(c *lextwt.BangMention) *BangMention { + return &BangMention{ + Name: c.Name(), + Target: c.Target(), + } +} +func (c *BangMention) ToLextwt() *lextwt.BangMention { + return lextwt.NewBangMention(c.Name, c.Target) +} + +func fromMention(c *lextwt.Mention) *Mention { + return &Mention{ + Name: c.Name(), + Target: c.Target(), + } +} +func (c *Mention) ToLextwt() *lextwt.Mention { + return lextwt.NewMention(c.Name, c.Target) +} + +func fromTag(c *lextwt.Tag) *Tag { + return &Tag{ + Tag: c.Text(), + Target: c.Target(), + } +} +func (c *Tag) ToLextwt() *lextwt.Tag { + return lextwt.NewTag(c.Tag, c.Target) +} + +func fromLineSeparator() *LineSeparator { + return &LineSeparator{} +} +func (c *LineSeparator) ToLextwt() lextwt.Elem { + return lextwt.LineSeparator +} + +func fromLink(c *lextwt.Link) *Link { + return &Link{ + Type: Link_Type(c.LinkType()), + Alt: c.Text(), + Target: c.Target(), + Title: c.Title(), + } +} +func (c *Link) ToLextwt() *lextwt.Link { + if c.Type == Link_Type(lextwt.LinkMedia) { + return lextwt.NewMedia(c.Alt, c.Target, c.Title) + } + return lextwt.NewLink(c.Alt, c.Target, lextwt.LinkType(c.Type)) +} + +func fromSubject(c *lextwt.Subject) *Subject { + if tag, ok := c.Tag().(*lextwt.Tag); ok { + return &Subject{ + Tag: fromTag(tag), + } + } + return &Subject{ + Subject: c.Text(), + } +} +func (c *Subject) ToLextwt() *lextwt.Subject { + if c.Tag != nil { + return lextwt.NewSubjectTag(c.Tag.Tag, c.Tag.Target) + } + return lextwt.NewSubject(c.Subject) +} + +func fromText(c *lextwt.Text) *Text { + return &Text{ + Text: c.Literal(), + } +} +func (c *Text) ToLextwt() *lextwt.Text { + return lextwt.NewText(c.Text) +} diff --git a/twt-pb/helper_test.go b/twt-pb/helper_test.go new file mode 100644 index 0000000..e2a3c2c --- /dev/null +++ b/twt-pb/helper_test.go @@ -0,0 +1,2 @@ +package twt_pb_test + diff --git a/twt-pb/lextwt.pb.go b/twt-pb/lextwt.pb.go new file mode 100644 index 0000000..144f5ea --- /dev/null +++ b/twt-pb/lextwt.pb.go @@ -0,0 +1,1252 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc v3.19.6 +// source: lextwt.proto + +package twt_pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Code_Type int32 + +const ( + Code_CODE_UNSPECIFIED Code_Type = 0 + Code_CODE_INLINE Code_Type = 1 + Code_CODE_BLOCK Code_Type = 2 +) + +// Enum value maps for Code_Type. +var ( + Code_Type_name = map[int32]string{ + 0: "CODE_UNSPECIFIED", + 1: "CODE_INLINE", + 2: "CODE_BLOCK", + } + Code_Type_value = map[string]int32{ + "CODE_UNSPECIFIED": 0, + "CODE_INLINE": 1, + "CODE_BLOCK": 2, + } +) + +func (x Code_Type) Enum() *Code_Type { + p := new(Code_Type) + *p = x + return p +} + +func (x Code_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Code_Type) Descriptor() protoreflect.EnumDescriptor { + return file_lextwt_proto_enumTypes[0].Descriptor() +} + +func (Code_Type) Type() protoreflect.EnumType { + return &file_lextwt_proto_enumTypes[0] +} + +func (x Code_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Code_Type.Descriptor instead. +func (Code_Type) EnumDescriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{3, 0} +} + +type Link_Type int32 + +const ( + Link_LINK_UNSPECIFIED Link_Type = 0 + Link_LINK_STANDARD Link_Type = 1 + Link_LINK_MEDIA Link_Type = 2 + Link_LINK_PLAIN Link_Type = 3 + Link_LINK_NAKED Link_Type = 4 +) + +// Enum value maps for Link_Type. +var ( + Link_Type_name = map[int32]string{ + 0: "LINK_UNSPECIFIED", + 1: "LINK_STANDARD", + 2: "LINK_MEDIA", + 3: "LINK_PLAIN", + 4: "LINK_NAKED", + } + Link_Type_value = map[string]int32{ + "LINK_UNSPECIFIED": 0, + "LINK_STANDARD": 1, + "LINK_MEDIA": 2, + "LINK_PLAIN": 3, + "LINK_NAKED": 4, + } +) + +func (x Link_Type) Enum() *Link_Type { + p := new(Link_Type) + *p = x + return p +} + +func (x Link_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Link_Type) Descriptor() protoreflect.EnumDescriptor { + return file_lextwt_proto_enumTypes[1].Descriptor() +} + +func (Link_Type) Type() protoreflect.EnumType { + return &file_lextwt_proto_enumTypes[1] +} + +func (x Link_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Link_Type.Descriptor instead. +func (Link_Type) EnumDescriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{7, 0} +} + +type LatestTwts struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LatestTwts) Reset() { + *x = LatestTwts{} + mi := &file_lextwt_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LatestTwts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LatestTwts) ProtoMessage() {} + +func (x *LatestTwts) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LatestTwts.ProtoReflect.Descriptor instead. +func (*LatestTwts) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{0} +} + +type TwtRegistry struct { + state protoimpl.MessageState `protogen:"open.v1"` + Preamble []*Comment `protobuf:"bytes,1,rep,name=preamble,proto3" json:"preamble,omitempty"` + Twters []*Twter `protobuf:"bytes,2,rep,name=twters,proto3" json:"twters,omitempty"` + Twts []*Twt `protobuf:"bytes,3,rep,name=twts,proto3" json:"twts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TwtRegistry) Reset() { + *x = TwtRegistry{} + mi := &file_lextwt_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TwtRegistry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TwtRegistry) ProtoMessage() {} + +func (x *TwtRegistry) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TwtRegistry.ProtoReflect.Descriptor instead. +func (*TwtRegistry) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{1} +} + +func (x *TwtRegistry) GetPreamble() []*Comment { + if x != nil { + return x.Preamble + } + return nil +} + +func (x *TwtRegistry) GetTwters() []*Twter { + if x != nil { + return x.Twters + } + return nil +} + +func (x *TwtRegistry) GetTwts() []*Twt { + if x != nil { + return x.Twts + } + return nil +} + +type BangMention struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BangMention) Reset() { + *x = BangMention{} + mi := &file_lextwt_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BangMention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BangMention) ProtoMessage() {} + +func (x *BangMention) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BangMention.ProtoReflect.Descriptor instead. +func (*BangMention) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{2} +} + +func (x *BangMention) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BangMention) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +type Code struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type Code_Type `protobuf:"varint,1,opt,name=type,proto3,enum=Code_Type" json:"type,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Code) Reset() { + *x = Code{} + mi := &file_lextwt_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Code) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Code) ProtoMessage() {} + +func (x *Code) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Code.ProtoReflect.Descriptor instead. +func (*Code) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{3} +} + +func (x *Code) GetType() Code_Type { + if x != nil { + return x.Type + } + return Code_CODE_UNSPECIFIED +} + +func (x *Code) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type Comment struct { + state protoimpl.MessageState `protogen:"open.v1"` + Comment string `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Comment) Reset() { + *x = Comment{} + mi := &file_lextwt_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Comment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Comment) ProtoMessage() {} + +func (x *Comment) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Comment.ProtoReflect.Descriptor instead. +func (*Comment) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{4} +} + +func (x *Comment) GetComment() string { + if x != nil { + return x.Comment + } + return "" +} + +func (x *Comment) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Comment) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type DateTime struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DateTime) Reset() { + *x = DateTime{} + mi := &file_lextwt_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DateTime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DateTime) ProtoMessage() {} + +func (x *DateTime) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DateTime.ProtoReflect.Descriptor instead. +func (*DateTime) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{5} +} + +func (x *DateTime) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DateTime) GetOffset() int32 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *DateTime) GetZone() string { + if x != nil { + return x.Zone + } + return "" +} + +type LineSeparator struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LineSeparator) Reset() { + *x = LineSeparator{} + mi := &file_lextwt_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LineSeparator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LineSeparator) ProtoMessage() {} + +func (x *LineSeparator) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LineSeparator.ProtoReflect.Descriptor instead. +func (*LineSeparator) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{6} +} + +type Link struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type Link_Type `protobuf:"varint,1,opt,name=type,proto3,enum=Link_Type" json:"type,omitempty"` + Alt string `protobuf:"bytes,2,opt,name=alt,proto3" json:"alt,omitempty"` + Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Link) Reset() { + *x = Link{} + mi := &file_lextwt_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Link) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Link) ProtoMessage() {} + +func (x *Link) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Link.ProtoReflect.Descriptor instead. +func (*Link) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{7} +} + +func (x *Link) GetType() Link_Type { + if x != nil { + return x.Type + } + return Link_LINK_UNSPECIFIED +} + +func (x *Link) GetAlt() string { + if x != nil { + return x.Alt + } + return "" +} + +func (x *Link) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *Link) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type Mention struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Mention) Reset() { + *x = Mention{} + mi := &file_lextwt_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Mention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mention) ProtoMessage() {} + +func (x *Mention) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Mention.ProtoReflect.Descriptor instead. +func (*Mention) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{8} +} + +func (x *Mention) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Mention) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +type Subject struct { + state protoimpl.MessageState `protogen:"open.v1"` + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Tag *Tag `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Subject) Reset() { + *x = Subject{} + mi := &file_lextwt_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Subject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Subject) ProtoMessage() {} + +func (x *Subject) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Subject.ProtoReflect.Descriptor instead. +func (*Subject) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{9} +} + +func (x *Subject) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Subject) GetTag() *Tag { + if x != nil { + return x.Tag + } + return nil +} + +type Tag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Tag) Reset() { + *x = Tag{} + mi := &file_lextwt_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Tag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tag) ProtoMessage() {} + +func (x *Tag) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tag.ProtoReflect.Descriptor instead. +func (*Tag) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{10} +} + +func (x *Tag) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *Tag) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +type Text struct { + state protoimpl.MessageState `protogen:"open.v1"` + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Text) Reset() { + *x = Text{} + mi := &file_lextwt_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Text) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Text) ProtoMessage() {} + +func (x *Text) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Text.ProtoReflect.Descriptor instead. +func (*Text) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{11} +} + +func (x *Text) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +type Twter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Nick string `protobuf:"bytes,1,opt,name=nick,proto3" json:"nick,omitempty"` + Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Twter) Reset() { + *x = Twter{} + mi := &file_lextwt_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Twter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Twter) ProtoMessage() {} + +func (x *Twter) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Twter.ProtoReflect.Descriptor instead. +func (*Twter) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{12} +} + +func (x *Twter) GetNick() string { + if x != nil { + return x.Nick + } + return "" +} + +func (x *Twter) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +type Elem struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Elem: + // + // *Elem_Bangmention + // *Elem_Code + // *Elem_Comment + // *Elem_Lineseparator + // *Elem_Link + // *Elem_Mention + // *Elem_Subject + // *Elem_Tag + // *Elem_Text + Elem isElem_Elem `protobuf_oneof:"elem"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Elem) Reset() { + *x = Elem{} + mi := &file_lextwt_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Elem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Elem) ProtoMessage() {} + +func (x *Elem) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Elem.ProtoReflect.Descriptor instead. +func (*Elem) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{13} +} + +func (x *Elem) GetElem() isElem_Elem { + if x != nil { + return x.Elem + } + return nil +} + +func (x *Elem) GetBangmention() *BangMention { + if x != nil { + if x, ok := x.Elem.(*Elem_Bangmention); ok { + return x.Bangmention + } + } + return nil +} + +func (x *Elem) GetCode() *Code { + if x != nil { + if x, ok := x.Elem.(*Elem_Code); ok { + return x.Code + } + } + return nil +} + +func (x *Elem) GetComment() *Comment { + if x != nil { + if x, ok := x.Elem.(*Elem_Comment); ok { + return x.Comment + } + } + return nil +} + +func (x *Elem) GetLineseparator() *LineSeparator { + if x != nil { + if x, ok := x.Elem.(*Elem_Lineseparator); ok { + return x.Lineseparator + } + } + return nil +} + +func (x *Elem) GetLink() *Link { + if x != nil { + if x, ok := x.Elem.(*Elem_Link); ok { + return x.Link + } + } + return nil +} + +func (x *Elem) GetMention() *Mention { + if x != nil { + if x, ok := x.Elem.(*Elem_Mention); ok { + return x.Mention + } + } + return nil +} + +func (x *Elem) GetSubject() *Subject { + if x != nil { + if x, ok := x.Elem.(*Elem_Subject); ok { + return x.Subject + } + } + return nil +} + +func (x *Elem) GetTag() *Tag { + if x != nil { + if x, ok := x.Elem.(*Elem_Tag); ok { + return x.Tag + } + } + return nil +} + +func (x *Elem) GetText() *Text { + if x != nil { + if x, ok := x.Elem.(*Elem_Text); ok { + return x.Text + } + } + return nil +} + +type isElem_Elem interface { + isElem_Elem() +} + +type Elem_Bangmention struct { + Bangmention *BangMention `protobuf:"bytes,1,opt,name=bangmention,proto3,oneof"` +} + +type Elem_Code struct { + Code *Code `protobuf:"bytes,2,opt,name=code,proto3,oneof"` +} + +type Elem_Comment struct { + Comment *Comment `protobuf:"bytes,3,opt,name=comment,proto3,oneof"` +} + +type Elem_Lineseparator struct { + Lineseparator *LineSeparator `protobuf:"bytes,4,opt,name=lineseparator,proto3,oneof"` +} + +type Elem_Link struct { + Link *Link `protobuf:"bytes,5,opt,name=link,proto3,oneof"` +} + +type Elem_Mention struct { + Mention *Mention `protobuf:"bytes,6,opt,name=mention,proto3,oneof"` +} + +type Elem_Subject struct { + Subject *Subject `protobuf:"bytes,7,opt,name=subject,proto3,oneof"` +} + +type Elem_Tag struct { + Tag *Tag `protobuf:"bytes,8,opt,name=tag,proto3,oneof"` +} + +type Elem_Text struct { + Text *Text `protobuf:"bytes,9,opt,name=text,proto3,oneof"` +} + +func (*Elem_Bangmention) isElem_Elem() {} + +func (*Elem_Code) isElem_Elem() {} + +func (*Elem_Comment) isElem_Elem() {} + +func (*Elem_Lineseparator) isElem_Elem() {} + +func (*Elem_Link) isElem_Elem() {} + +func (*Elem_Mention) isElem_Elem() {} + +func (*Elem_Subject) isElem_Elem() {} + +func (*Elem_Tag) isElem_Elem() {} + +func (*Elem_Text) isElem_Elem() {} + +type Twt struct { + state protoimpl.MessageState `protogen:"open.v1"` + Twter *Twter `protobuf:"bytes,1,opt,name=twter,proto3" json:"twter,omitempty"` + Created *DateTime `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` + Msg []*Elem `protobuf:"bytes,3,rep,name=msg,proto3" json:"msg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Twt) Reset() { + *x = Twt{} + mi := &file_lextwt_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Twt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Twt) ProtoMessage() {} + +func (x *Twt) ProtoReflect() protoreflect.Message { + mi := &file_lextwt_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Twt.ProtoReflect.Descriptor instead. +func (*Twt) Descriptor() ([]byte, []int) { + return file_lextwt_proto_rawDescGZIP(), []int{14} +} + +func (x *Twt) GetTwter() *Twter { + if x != nil { + return x.Twter + } + return nil +} + +func (x *Twt) GetCreated() *DateTime { + if x != nil { + return x.Created + } + return nil +} + +func (x *Twt) GetMsg() []*Elem { + if x != nil { + return x.Msg + } + return nil +} + +var File_lextwt_proto protoreflect.FileDescriptor + +var file_lextwt_proto_rawDesc = string([]byte{ + 0x0a, 0x0c, 0x6c, 0x65, 0x78, 0x74, 0x77, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0c, + 0x0a, 0x0a, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x77, 0x74, 0x73, 0x22, 0x6d, 0x0a, 0x0b, + 0x54, 0x77, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x08, 0x70, + 0x72, 0x65, 0x61, 0x6d, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x72, 0x65, 0x61, 0x6d, 0x62, 0x6c, + 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x74, 0x77, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x06, 0x2e, 0x54, 0x77, 0x74, 0x65, 0x72, 0x52, 0x06, 0x74, 0x77, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x18, 0x0a, 0x04, 0x74, 0x77, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x04, 0x2e, 0x54, 0x77, 0x74, 0x52, 0x04, 0x74, 0x77, 0x74, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x42, + 0x61, 0x6e, 0x67, 0x4d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x79, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x43, + 0x6f, 0x64, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x22, 0x3d, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, + 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, + 0x02, 0x22, 0x4b, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x54, + 0x0a, 0x08, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x7a, 0x6f, 0x6e, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x70, 0x61, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xc7, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1e, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x4c, + 0x69, 0x6e, 0x6b, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x6c, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x5f, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x10, 0x02, 0x12, + 0x0e, 0x0a, 0x0a, 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x03, 0x12, + 0x0e, 0x0a, 0x0a, 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x4e, 0x41, 0x4b, 0x45, 0x44, 0x10, 0x04, 0x22, + 0x35, 0x0a, 0x07, 0x4d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x3b, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x03, 0x74, + 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x03, + 0x74, 0x61, 0x67, 0x22, 0x2f, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, + 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x22, 0x1a, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x22, 0x2d, 0x0a, 0x05, 0x54, 0x77, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x69, 0x63, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x22, + 0xdb, 0x02, 0x0a, 0x04, 0x45, 0x6c, 0x65, 0x6d, 0x12, 0x30, 0x0a, 0x0b, 0x62, 0x61, 0x6e, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x42, 0x61, 0x6e, 0x67, 0x4d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x62, + 0x61, 0x6e, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x48, + 0x00, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x36, 0x0a, + 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x70, 0x61, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x65, 0x70, 0x61, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x69, + 0x6e, 0x6b, 0x12, 0x24, 0x0a, 0x07, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, + 0x07, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x18, + 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x54, 0x61, + 0x67, 0x48, 0x00, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x61, 0x0a, + 0x03, 0x54, 0x77, 0x74, 0x12, 0x1c, 0x0a, 0x05, 0x74, 0x77, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x54, 0x77, 0x74, 0x65, 0x72, 0x52, 0x05, 0x74, 0x77, 0x74, + 0x65, 0x72, 0x12, 0x23, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x6c, 0x65, 0x6d, 0x52, 0x03, 0x6d, 0x73, 0x67, + 0x32, 0x3d, 0x0a, 0x12, 0x54, 0x77, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x54, 0x77, 0x74, 0x73, 0x12, 0x0b, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x77, 0x74, + 0x73, 0x1a, 0x0c, 0x2e, 0x54, 0x77, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x42, + 0x1c, 0x5a, 0x1a, 0x67, 0x6f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x2e, 0x69, 0x73, 0x2f, 0x6c, 0x65, + 0x78, 0x74, 0x77, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_lextwt_proto_rawDescOnce sync.Once + file_lextwt_proto_rawDescData []byte +) + +func file_lextwt_proto_rawDescGZIP() []byte { + file_lextwt_proto_rawDescOnce.Do(func() { + file_lextwt_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_lextwt_proto_rawDesc), len(file_lextwt_proto_rawDesc))) + }) + return file_lextwt_proto_rawDescData +} + +var file_lextwt_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_lextwt_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_lextwt_proto_goTypes = []any{ + (Code_Type)(0), // 0: Code.Type + (Link_Type)(0), // 1: Link.Type + (*LatestTwts)(nil), // 2: LatestTwts + (*TwtRegistry)(nil), // 3: TwtRegistry + (*BangMention)(nil), // 4: BangMention + (*Code)(nil), // 5: Code + (*Comment)(nil), // 6: Comment + (*DateTime)(nil), // 7: DateTime + (*LineSeparator)(nil), // 8: LineSeparator + (*Link)(nil), // 9: Link + (*Mention)(nil), // 10: Mention + (*Subject)(nil), // 11: Subject + (*Tag)(nil), // 12: Tag + (*Text)(nil), // 13: Text + (*Twter)(nil), // 14: Twter + (*Elem)(nil), // 15: Elem + (*Twt)(nil), // 16: Twt +} +var file_lextwt_proto_depIdxs = []int32{ + 6, // 0: TwtRegistry.preamble:type_name -> Comment + 14, // 1: TwtRegistry.twters:type_name -> Twter + 16, // 2: TwtRegistry.twts:type_name -> Twt + 0, // 3: Code.type:type_name -> Code.Type + 1, // 4: Link.type:type_name -> Link.Type + 12, // 5: Subject.tag:type_name -> Tag + 4, // 6: Elem.bangmention:type_name -> BangMention + 5, // 7: Elem.code:type_name -> Code + 6, // 8: Elem.comment:type_name -> Comment + 8, // 9: Elem.lineseparator:type_name -> LineSeparator + 9, // 10: Elem.link:type_name -> Link + 10, // 11: Elem.mention:type_name -> Mention + 11, // 12: Elem.subject:type_name -> Subject + 12, // 13: Elem.tag:type_name -> Tag + 13, // 14: Elem.text:type_name -> Text + 14, // 15: Twt.twter:type_name -> Twter + 7, // 16: Twt.created:type_name -> DateTime + 15, // 17: Twt.msg:type_name -> Elem + 2, // 18: TwtRegistryService.latestTwts:input_type -> LatestTwts + 3, // 19: TwtRegistryService.latestTwts:output_type -> TwtRegistry + 19, // [19:20] is the sub-list for method output_type + 18, // [18:19] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_lextwt_proto_init() } +func file_lextwt_proto_init() { + if File_lextwt_proto != nil { + return + } + file_lextwt_proto_msgTypes[13].OneofWrappers = []any{ + (*Elem_Bangmention)(nil), + (*Elem_Code)(nil), + (*Elem_Comment)(nil), + (*Elem_Lineseparator)(nil), + (*Elem_Link)(nil), + (*Elem_Mention)(nil), + (*Elem_Subject)(nil), + (*Elem_Tag)(nil), + (*Elem_Text)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_lextwt_proto_rawDesc), len(file_lextwt_proto_rawDesc)), + NumEnums: 2, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_lextwt_proto_goTypes, + DependencyIndexes: file_lextwt_proto_depIdxs, + EnumInfos: file_lextwt_proto_enumTypes, + MessageInfos: file_lextwt_proto_msgTypes, + }.Build() + File_lextwt_proto = out.File + file_lextwt_proto_goTypes = nil + file_lextwt_proto_depIdxs = nil +}