Initial protobuf

This commit is contained in:
Daniel 2024-07-31 09:24:05 -04:00
parent 6439d9336b
commit b4e01c80c5
3 changed files with 266 additions and 0 deletions

View file

@ -3,3 +3,4 @@ all:
generate:
sqlc generate -f sql/sqlc.yaml
protoc -I=pkg/pb/ --go_out=pkg/ pkg/pb/stillbox.proto

246
pkg/pb/stillbox.pb.go Normal file
View file

@ -0,0 +1,246 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v5.27.2
// source: stillbox.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
)
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 Call struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AudioName string `protobuf:"bytes,1,opt,name=audio_name,json=audioName,proto3" json:"audio_name,omitempty"`
AudioType string `protobuf:"bytes,2,opt,name=audio_type,json=audioType,proto3" json:"audio_type,omitempty"`
DateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=date_time,json=dateTime,proto3" json:"date_time,omitempty"`
System int32 `protobuf:"varint,4,opt,name=system,proto3" json:"system,omitempty"`
Talkgroup int32 `protobuf:"varint,5,opt,name=talkgroup,proto3" json:"talkgroup,omitempty"`
Source int32 `protobuf:"varint,6,opt,name=source,proto3" json:"source,omitempty"`
Frequency int64 `protobuf:"varint,7,opt,name=frequency,proto3" json:"frequency,omitempty"`
Frequencies []int64 `protobuf:"varint,8,rep,packed,name=frequencies,proto3" json:"frequencies,omitempty"`
Patches []int32 `protobuf:"varint,9,rep,packed,name=patches,proto3" json:"patches,omitempty"`
Sources []int32 `protobuf:"varint,10,rep,packed,name=sources,proto3" json:"sources,omitempty"`
Audio []byte `protobuf:"bytes,11,opt,name=audio,proto3" json:"audio,omitempty"`
}
func (x *Call) Reset() {
*x = Call{}
if protoimpl.UnsafeEnabled {
mi := &file_stillbox_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Call) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Call) ProtoMessage() {}
func (x *Call) ProtoReflect() protoreflect.Message {
mi := &file_stillbox_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 Call.ProtoReflect.Descriptor instead.
func (*Call) Descriptor() ([]byte, []int) {
return file_stillbox_proto_rawDescGZIP(), []int{0}
}
func (x *Call) GetAudioName() string {
if x != nil {
return x.AudioName
}
return ""
}
func (x *Call) GetAudioType() string {
if x != nil {
return x.AudioType
}
return ""
}
func (x *Call) GetDateTime() *timestamppb.Timestamp {
if x != nil {
return x.DateTime
}
return nil
}
func (x *Call) GetSystem() int32 {
if x != nil {
return x.System
}
return 0
}
func (x *Call) GetTalkgroup() int32 {
if x != nil {
return x.Talkgroup
}
return 0
}
func (x *Call) GetSource() int32 {
if x != nil {
return x.Source
}
return 0
}
func (x *Call) GetFrequency() int64 {
if x != nil {
return x.Frequency
}
return 0
}
func (x *Call) GetFrequencies() []int64 {
if x != nil {
return x.Frequencies
}
return nil
}
func (x *Call) GetPatches() []int32 {
if x != nil {
return x.Patches
}
return nil
}
func (x *Call) GetSources() []int32 {
if x != nil {
return x.Sources
}
return nil
}
func (x *Call) GetAudio() []byte {
if x != nil {
return x.Audio
}
return nil
}
var File_stillbox_proto protoreflect.FileDescriptor
var file_stillbox_proto_rawDesc = []byte{
0x0a, 0x0e, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x62, 0x6f, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x08, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x62, 0x6f, 0x78, 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, 0x22, 0xd5, 0x02, 0x0a, 0x04,
0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x79,
0x70, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x52, 0x08, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x67, 0x72, 0x6f, 0x75,
0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65,
0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72,
0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x65, 0x71, 0x75,
0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x66, 0x72,
0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74,
0x63, 0x68, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x74, 0x63,
0x68, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0a,
0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x75,
0x64, 0x69, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stillbox_proto_rawDescOnce sync.Once
file_stillbox_proto_rawDescData = file_stillbox_proto_rawDesc
)
func file_stillbox_proto_rawDescGZIP() []byte {
file_stillbox_proto_rawDescOnce.Do(func() {
file_stillbox_proto_rawDescData = protoimpl.X.CompressGZIP(file_stillbox_proto_rawDescData)
})
return file_stillbox_proto_rawDescData
}
var file_stillbox_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_stillbox_proto_goTypes = []any{
(*Call)(nil), // 0: stillbox.Call
(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
}
var file_stillbox_proto_depIdxs = []int32{
1, // 0: stillbox.Call.date_time:type_name -> google.protobuf.Timestamp
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_stillbox_proto_init() }
func file_stillbox_proto_init() {
if File_stillbox_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stillbox_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Call); 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_stillbox_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stillbox_proto_goTypes,
DependencyIndexes: file_stillbox_proto_depIdxs,
MessageInfos: file_stillbox_proto_msgTypes,
}.Build()
File_stillbox_proto = out.File
file_stillbox_proto_rawDesc = nil
file_stillbox_proto_goTypes = nil
file_stillbox_proto_depIdxs = nil
}

19
pkg/pb/stillbox.proto Normal file
View file

@ -0,0 +1,19 @@
syntax = "proto3";
package stillbox;
option go_package = "./pb";
import "google/protobuf/timestamp.proto";
message Call {
string audio_name = 1;
string audio_type = 2;
google.protobuf.Timestamp date_time = 3;
int32 system = 4;
int32 talkgroup = 5;
int32 source = 6;
int64 frequency = 7;
repeated int64 frequencies = 8;
repeated int32 patches = 9;
repeated int32 sources = 10;
bytes audio = 11;
}