guipb/7134618aa87966357e3267374de...

1145 lines
30 KiB
Plaintext

// `autogen:go.mod`
module go.wit.com/lib/protobuf/guipb
go 1.22
toolchain go1.23.6
require google.golang.org/protobuf v1.36.5
// `autogen:go.sum`
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=
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/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
// `autogen:table.marshal.pb.go`
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.0.52-1-g4fdcc99 2025.02.12_1512
// go install go.wit.com/apps/autogenpb@latest
//
// define which structs (messages) you want to use in the .proto file
// Then sort.pb.go and marshal.pb.go files are autogenerated
//
// autogenpb uses it and has an example .proto file with instructions
//
package guipb
import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
)
// human readable JSON
func (v *Tables) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Tables) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Tables) UnmarshalJSON(data []byte) error {
return protojson.Unmarshal(data, v)
}
// apparently this isn't stable, but it's awesomely better
// https://protobuf.dev/reference/go/faq/#unstable-text
// it's brilliant for config files!
func (v *Tables) FormatTEXT() string {
v.fixUuid()
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Tables) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Tables) Marshal() ([]byte, error) {
v.fixUuid()
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Tables) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
// human readable JSON
func (v *Table) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Table) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Table) UnmarshalJSON(data []byte) error {
return protojson.Unmarshal(data, v)
}
// apparently this isn't stable, but it's awesomely better
// https://protobuf.dev/reference/go/faq/#unstable-text
// it's brilliant for config files!
func (v *Table) FormatTEXT() string {
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Table) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Table) Marshal() ([]byte, error) {
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Table) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
// `autogen:table.pb.go`
// Code modified by go.wit.com/apps/autogenpb DO NOT EDIT.
//
// user defined Mutex locks were auto added
//
// autogenpb version & build time: v0.0.52-1-g4fdcc99 2025.02.12_1512
// autogenpb auto generates Sort(), Unique() and Marshal() functions
// go install go.wit.com/apps/autogenpb@latest
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc v3.21.12
// source: table.proto
// playing around with ideas here
package guipb // autogenpb changed the package name
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/timestamppb"
)
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 StringRow struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` //
Vals []string `protobuf:"bytes,2,rep,name=vals,proto3" json:"vals,omitempty"` //
WidgetS []*Widget `protobuf:"bytes,3,rep,name=widgetS,proto3" json:"widgetS,omitempty"` //
}
func (x *StringRow) Reset() {
*x = StringRow{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StringRow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StringRow) ProtoMessage() {}
func (x *StringRow) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StringRow.ProtoReflect.Descriptor instead.
func (*StringRow) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{0}
}
func (x *StringRow) GetHeader() string {
if x != nil {
return x.Header
}
return ""
}
func (x *StringRow) GetVals() []string {
if x != nil {
return x.Vals
}
return nil
}
func (x *StringRow) GetWidgetS() []*Widget {
if x != nil {
return x.WidgetS
}
return nil
}
type IntRow struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header *Widget `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` //
Widgets []*Widget `protobuf:"bytes,2,rep,name=widgets,proto3" json:"widgets,omitempty"` //
}
func (x *IntRow) Reset() {
*x = IntRow{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IntRow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IntRow) ProtoMessage() {}
func (x *IntRow) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IntRow.ProtoReflect.Descriptor instead.
func (*IntRow) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{1}
}
func (x *IntRow) GetHeader() *Widget {
if x != nil {
return x.Header
}
return nil
}
func (x *IntRow) GetWidgets() []*Widget {
if x != nil {
return x.Widgets
}
return nil
}
type TimeRow struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header *Widget `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` //
Widgets []*Widget `protobuf:"bytes,2,rep,name=widgets,proto3" json:"widgets,omitempty"` //
}
func (x *TimeRow) Reset() {
*x = TimeRow{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TimeRow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TimeRow) ProtoMessage() {}
func (x *TimeRow) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TimeRow.ProtoReflect.Descriptor instead.
func (*TimeRow) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{2}
}
func (x *TimeRow) GetHeader() *Widget {
if x != nil {
return x.Header
}
return nil
}
func (x *TimeRow) GetWidgets() []*Widget {
if x != nil {
return x.Widgets
}
return nil
}
type BoolRow struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header *Widget `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` //
Widgets []*Widget `protobuf:"bytes,2,rep,name=widgets,proto3" json:"widgets,omitempty"` //
}
func (x *BoolRow) Reset() {
*x = BoolRow{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BoolRow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BoolRow) ProtoMessage() {}
func (x *BoolRow) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BoolRow.ProtoReflect.Descriptor instead.
func (*BoolRow) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{3}
}
func (x *BoolRow) GetHeader() *Widget {
if x != nil {
return x.Header
}
return nil
}
func (x *BoolRow) GetWidgets() []*Widget {
if x != nil {
return x.Widgets
}
return nil
}
type Table struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Order []string `protobuf:"bytes,1,rep,name=order,proto3" json:"order,omitempty"`
StringRows []*StringRow `protobuf:"bytes,2,rep,name=StringRows,proto3" json:"StringRows,omitempty"`
IntRows []*IntRow `protobuf:"bytes,3,rep,name=IntRows,proto3" json:"IntRows,omitempty"`
TimeRows []*TimeRow `protobuf:"bytes,4,rep,name=TimeRows,proto3" json:"TimeRows,omitempty"`
BoolRows []*BoolRow `protobuf:"bytes,5,rep,name=BoolRows,proto3" json:"BoolRows,omitempty"`
}
func (x *Table) Reset() {
*x = Table{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Table) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Table) ProtoMessage() {}
func (x *Table) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Table.ProtoReflect.Descriptor instead.
func (*Table) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{4}
}
func (x *Table) GetOrder() []string {
if x != nil {
return x.Order
}
return nil
}
func (x *Table) GetStringRows() []*StringRow {
if x != nil {
return x.StringRows
}
return nil
}
func (x *Table) GetIntRows() []*IntRow {
if x != nil {
return x.IntRows
}
return nil
}
func (x *Table) GetTimeRows() []*TimeRow {
if x != nil {
return x.TimeRows
}
return nil
}
func (x *Table) GetBoolRows() []*BoolRow {
if x != nil {
return x.BoolRows
}
return nil
}
type Tables struct {
sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:c328aa62-3c4f-4d00-9244-cc44ae75ab1b`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v1`
Tables []*Table `protobuf:"bytes,3,rep,name=Tables,proto3" json:"Tables,omitempty"`
}
func (x *Tables) Reset() {
*x = Tables{}
if protoimpl.UnsafeEnabled {
mi := &file_table_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Tables) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Tables) ProtoMessage() {}
func (x *Tables) ProtoReflect() protoreflect.Message {
mi := &file_table_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Tables.ProtoReflect.Descriptor instead.
func (*Tables) Descriptor() ([]byte, []int) {
return file_table_proto_rawDescGZIP(), []int{5}
}
func (x *Tables) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
func (x *Tables) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *Tables) GetTables() []*Table {
if x != nil {
return x.Tables
}
return nil
}
var File_table_proto protoreflect.FileDescriptor
var file_table_proto_rawDesc = []byte{
0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x67,
0x69, 0x74, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x77,
0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x07,
0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x53, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x77, 0x69,
0x64, 0x67, 0x65, 0x74, 0x53, 0x22, 0x58, 0x0a, 0x06, 0x49, 0x6e, 0x74, 0x52, 0x6f, 0x77, 0x12,
0x25, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x52, 0x06,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x07, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e,
0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x73, 0x22,
0x59, 0x0a, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x6f, 0x77, 0x12, 0x25, 0x0a, 0x06, 0x68, 0x65,
0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74,
0x70, 0x62, 0x2e, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x12, 0x27, 0x0a, 0x07, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x69, 0x64, 0x67, 0x65,
0x74, 0x52, 0x07, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x73, 0x22, 0x59, 0x0a, 0x07, 0x42, 0x6f,
0x6f, 0x6c, 0x52, 0x6f, 0x77, 0x12, 0x25, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x69,
0x64, 0x67, 0x65, 0x74, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x07,
0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x77, 0x69,
0x64, 0x67, 0x65, 0x74, 0x73, 0x22, 0xd0, 0x01, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52,
0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x69, 0x74, 0x70,
0x62, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x77, 0x52, 0x0a, 0x53, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x49, 0x6e, 0x74, 0x52, 0x6f,
0x77, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62,
0x2e, 0x49, 0x6e, 0x74, 0x52, 0x6f, 0x77, 0x52, 0x07, 0x49, 0x6e, 0x74, 0x52, 0x6f, 0x77, 0x73,
0x12, 0x2a, 0x0a, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x18, 0x04, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52,
0x6f, 0x77, 0x52, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x2a, 0x0a, 0x08,
0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x6f, 0x77, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x6f, 0x77, 0x52, 0x08,
0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x5c, 0x0a, 0x06, 0x54, 0x61, 0x62, 0x6c,
0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x24, 0x0a, 0x06, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06,
0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_table_proto_rawDescOnce sync.Once
file_table_proto_rawDescData = file_table_proto_rawDesc
)
func file_table_proto_rawDescGZIP() []byte {
file_table_proto_rawDescOnce.Do(func() {
file_table_proto_rawDescData = protoimpl.X.CompressGZIP(file_table_proto_rawDescData)
})
return file_table_proto_rawDescData
}
var file_table_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_table_proto_goTypes = []interface{}{
(*StringRow)(nil), // 0: gitpb.StringRow
(*IntRow)(nil), // 1: gitpb.IntRow
(*TimeRow)(nil), // 2: gitpb.TimeRow
(*BoolRow)(nil), // 3: gitpb.BoolRow
(*Table)(nil), // 4: gitpb.Table
(*Tables)(nil), // 5: gitpb.Tables
(*Widget)(nil), // 6: gitpb.Widget
}
var file_table_proto_depIdxs = []int32{
6, // 0: gitpb.StringRow.widgetS:type_name -> gitpb.Widget
6, // 1: gitpb.IntRow.header:type_name -> gitpb.Widget
6, // 2: gitpb.IntRow.widgets:type_name -> gitpb.Widget
6, // 3: gitpb.TimeRow.header:type_name -> gitpb.Widget
6, // 4: gitpb.TimeRow.widgets:type_name -> gitpb.Widget
6, // 5: gitpb.BoolRow.header:type_name -> gitpb.Widget
6, // 6: gitpb.BoolRow.widgets:type_name -> gitpb.Widget
0, // 7: gitpb.Table.StringRows:type_name -> gitpb.StringRow
1, // 8: gitpb.Table.IntRows:type_name -> gitpb.IntRow
2, // 9: gitpb.Table.TimeRows:type_name -> gitpb.TimeRow
3, // 10: gitpb.Table.BoolRows:type_name -> gitpb.BoolRow
4, // 11: gitpb.Tables.Tables:type_name -> gitpb.Table
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_table_proto_init() }
func file_table_proto_init() {
if File_table_proto != nil {
return
}
file_widget_proto_init()
if !protoimpl.UnsafeEnabled {
file_table_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StringRow); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_table_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IntRow); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_table_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TimeRow); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_table_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BoolRow); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_table_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Table); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_table_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Tables); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_table_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_table_proto_goTypes,
DependencyIndexes: file_table_proto_depIdxs,
MessageInfos: file_table_proto_msgTypes,
}.Build()
File_table_proto = out.File
file_table_proto_rawDesc = nil
file_table_proto_goTypes = nil
file_table_proto_depIdxs = nil
}
// `autogen:table.sort.pb.go`
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.0.52-1-g4fdcc99 2025.02.12_1512
// go install go.wit.com/apps/autogenpb@latest
//
// define which structs (messages) you want to use in the .proto file
// Then sort.pb.go and marshal.pb.go files are autogenerated
//
// autogenpb uses it and has an example .proto file with instructions
//
package guipb
import (
"fmt"
"sync"
)
// a simple global lock
var tableMu sync.RWMutex
func (x *Tables) fixUuid() {
if x == nil {
return
}
if x.Uuid == "c328aa62-3c4f-4d00-9244-cc44ae75ab1b" {
return
}
x.Uuid = "c328aa62-3c4f-4d00-9244-cc44ae75ab1b"
x.Version = "v1 go.wit.com/lib/protobuf/guipb"
}
func NewTables() *Tables {
x := new(Tables)
x.Uuid = "c328aa62-3c4f-4d00-9244-cc44ae75ab1b"
x.Version = "v1 go.wit.com/lib/protobuf/guipb"
return x
}
// START SORT
// DEFINE THE Tables ITERATOR.
// itializes a new iterator.
func newTablesIterator(things []*Tables) *TablesIterator {
return &TablesIterator{things: things}
}
type TablesIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*Tables
index int
}
func (it *TablesIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *TablesIterator) Next() *Tables {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in TablesIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// DEFINE THE Table ITERATOR.
// itializes a new iterator.
func newTableIterator(things []*Table) *TableIterator {
return &TableIterator{things: things}
}
type TableIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*Table
index int
}
func (it *TableIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *TableIterator) Next() *Table {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in TableIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// DEFINE THE StringRow ITERATOR.
// itializes a new iterator.
func newStringRowIterator(things []*StringRow) *StringRowIterator {
return &StringRowIterator{things: things}
}
type StringRowIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*StringRow
index int
}
func (it *StringRowIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *StringRowIterator) Next() *StringRow {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in StringRowIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// DEFINE THE IntRow ITERATOR.
// itializes a new iterator.
func newIntRowIterator(things []*IntRow) *IntRowIterator {
return &IntRowIterator{things: things}
}
type IntRowIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*IntRow
index int
}
func (it *IntRowIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *IntRowIterator) Next() *IntRow {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in IntRowIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// DEFINE THE TimeRow ITERATOR.
// itializes a new iterator.
func newTimeRowIterator(things []*TimeRow) *TimeRowIterator {
return &TimeRowIterator{things: things}
}
type TimeRowIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*TimeRow
index int
}
func (it *TimeRowIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *TimeRowIterator) Next() *TimeRow {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in TimeRowIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// DEFINE THE BoolRow ITERATOR.
// itializes a new iterator.
func newBoolRowIterator(things []*BoolRow) *BoolRowIterator {
return &BoolRowIterator{things: things}
}
type BoolRowIterator struct {
sync.RWMutex // this isn't getting used properly yet?
things []*BoolRow
index int
}
func (it *BoolRowIterator) Scan() bool {
if it.index >= len(it.things) {
return false
}
it.index++
return true
}
// Next() returns the next thing in the array
func (it *BoolRowIterator) Next() *BoolRow {
if it.things[it.index-1] == nil {
fmt.Println("Next() error in BoolRowIterator", it.index)
}
return it.things[it.index-1]
}
// END DEFINE THE ITERATOR
// safely returns a slice of pointers to the FRUIT protobufs
func (x *Tables) allTables() []*Table {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each FRUIT
var tmp []*Table
tmp = make([]*Table, len(x.Tables))
for i, p := range x.Tables {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the FRUIT protobufs
func (x *Table) allStringRows() []*StringRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each FRUIT
var tmp []*StringRow
tmp = make([]*StringRow, len(x.StringRows))
for i, p := range x.StringRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the FRUIT protobufs
func (x *Table) allIntRows() []*IntRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each FRUIT
var tmp []*IntRow
tmp = make([]*IntRow, len(x.IntRows))
for i, p := range x.IntRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the FRUIT protobufs
func (x *Table) allTimeRows() []*TimeRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each FRUIT
var tmp []*TimeRow
tmp = make([]*TimeRow, len(x.TimeRows))
for i, p := range x.TimeRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the FRUIT protobufs
func (x *Table) allBoolRows() []*BoolRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each FRUIT
var tmp []*BoolRow
tmp = make([]*BoolRow, len(x.BoolRows))
for i, p := range x.BoolRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the Table protobufs
func (x *Tables) selectAllTables() []*Table {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each Table
var tmp []*Table
tmp = make([]*Table, len(x.Tables))
for i, p := range x.Tables {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the StringRow protobufs
func (x *Table) selectAllStringRows() []*StringRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each StringRow
var tmp []*StringRow
tmp = make([]*StringRow, len(x.StringRows))
for i, p := range x.StringRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the IntRow protobufs
func (x *Table) selectAllIntRows() []*IntRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each IntRow
var tmp []*IntRow
tmp = make([]*IntRow, len(x.IntRows))
for i, p := range x.IntRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the TimeRow protobufs
func (x *Table) selectAllTimeRows() []*TimeRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each TimeRow
var tmp []*TimeRow
tmp = make([]*TimeRow, len(x.TimeRows))
for i, p := range x.TimeRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// safely returns a slice of pointers to the BoolRow protobufs
func (x *Table) selectAllBoolRows() []*BoolRow {
x.RLock()
defer x.RUnlock()
// Create a new slice to hold pointers to each BoolRow
var tmp []*BoolRow
tmp = make([]*BoolRow, len(x.BoolRows))
for i, p := range x.BoolRows {
tmp[i] = p // Copy pointers for safe iteration
}
return tmp
}
// END SORT
func (x *Tables) Len() int {
x.RLock()
defer x.RUnlock()
return len(x.Tables)
}
// just a simple Append() shortcut (but still uses the mutex lock)
func (x *Tables) Append(y *Table) {
x.Lock()
defer x.Unlock()
x.Tables = append(x.Tables, y)
}
func (x *Tables) All() *TableIterator {
TablePointers := x.selectAllTables()
iterator := newTableIterator(TablePointers)
return iterator
}
func (x *Tables) Delete(y *Table) bool {
x.Lock()
defer x.Unlock()
for i, _ := range x.Tables {
if x.Tables[i] == y {
x.Tables[i] = x.Tables[len(x.Tables)-1]
x.Tables = x.Tables[:len(x.Tables)-1]
return true
}
}
return false
}
// `autogen:widget.marshal.pb.go`