feat: add event and slug proto
This commit is contained in:
280
gen/events.pb.go
Normal file
280
gen/events.pb.go
Normal file
@@ -0,0 +1,280 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: events.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
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 EventType int32
|
||||
|
||||
const (
|
||||
EventType_SLUG_CHANGE EventType = 0
|
||||
)
|
||||
|
||||
// Enum value maps for EventType.
|
||||
var (
|
||||
EventType_name = map[int32]string{
|
||||
0: "SLUG_CHANGE",
|
||||
}
|
||||
EventType_value = map[string]int32{
|
||||
"SLUG_CHANGE": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x EventType) Enum() *EventType {
|
||||
p := new(EventType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x EventType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (EventType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_events_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (EventType) Type() protoreflect.EnumType {
|
||||
return &file_events_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x EventType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventType.Descriptor instead.
|
||||
func (EventType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_events_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Event struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=events.EventType" json:"type,omitempty"`
|
||||
TimestampUnixMs int64 `protobuf:"varint,2,opt,name=timestamp_unix_ms,json=timestampUnixMs,proto3" json:"timestamp_unix_ms,omitempty"`
|
||||
// Types that are valid to be assigned to Data:
|
||||
//
|
||||
// *Event_DataEvent
|
||||
Data isEvent_Data `protobuf_oneof:"data"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Event) Reset() {
|
||||
*x = Event{}
|
||||
mi := &file_events_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Event) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Event) ProtoMessage() {}
|
||||
|
||||
func (x *Event) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_events_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 Event.ProtoReflect.Descriptor instead.
|
||||
func (*Event) Descriptor() ([]byte, []int) {
|
||||
return file_events_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Event) GetType() EventType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return EventType_SLUG_CHANGE
|
||||
}
|
||||
|
||||
func (x *Event) GetTimestampUnixMs() int64 {
|
||||
if x != nil {
|
||||
return x.TimestampUnixMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Event) GetData() isEvent_Data {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Event) GetDataEvent() *SlugChangeEvent {
|
||||
if x != nil {
|
||||
if x, ok := x.Data.(*Event_DataEvent); ok {
|
||||
return x.DataEvent
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isEvent_Data interface {
|
||||
isEvent_Data()
|
||||
}
|
||||
|
||||
type Event_DataEvent struct {
|
||||
DataEvent *SlugChangeEvent `protobuf:"bytes,10,opt,name=data_event,json=dataEvent,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Event_DataEvent) isEvent_Data() {}
|
||||
|
||||
type SlugChangeEvent struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Old string `protobuf:"bytes,1,opt,name=old,proto3" json:"old,omitempty"`
|
||||
New string `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SlugChangeEvent) Reset() {
|
||||
*x = SlugChangeEvent{}
|
||||
mi := &file_events_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SlugChangeEvent) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SlugChangeEvent) ProtoMessage() {}
|
||||
|
||||
func (x *SlugChangeEvent) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_events_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 SlugChangeEvent.ProtoReflect.Descriptor instead.
|
||||
func (*SlugChangeEvent) Descriptor() ([]byte, []int) {
|
||||
return file_events_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SlugChangeEvent) GetOld() string {
|
||||
if x != nil {
|
||||
return x.Old
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SlugChangeEvent) GetNew() string {
|
||||
if x != nil {
|
||||
return x.New
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_events_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_events_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\fevents.proto\x12\x06events\x1a\x1bgoogle/protobuf/empty.proto\"\x9c\x01\n" +
|
||||
"\x05Event\x12%\n" +
|
||||
"\x04type\x18\x01 \x01(\x0e2\x11.events.EventTypeR\x04type\x12*\n" +
|
||||
"\x11timestamp_unix_ms\x18\x02 \x01(\x03R\x0ftimestampUnixMs\x128\n" +
|
||||
"\n" +
|
||||
"data_event\x18\n" +
|
||||
" \x01(\v2\x17.events.SlugChangeEventH\x00R\tdataEventB\x06\n" +
|
||||
"\x04data\"5\n" +
|
||||
"\x0fSlugChangeEvent\x12\x10\n" +
|
||||
"\x03old\x18\x01 \x01(\tR\x03old\x12\x10\n" +
|
||||
"\x03new\x18\x02 \x01(\tR\x03new*\x1c\n" +
|
||||
"\tEventType\x12\x0f\n" +
|
||||
"\vSLUG_CHANGE\x10\x002D\n" +
|
||||
"\fEventService\x124\n" +
|
||||
"\tSubscribe\x12\x16.google.protobuf.Empty\x1a\r.events.Event0\x01B\aZ\x05./genb\x06proto3"
|
||||
|
||||
var (
|
||||
file_events_proto_rawDescOnce sync.Once
|
||||
file_events_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_events_proto_rawDescGZIP() []byte {
|
||||
file_events_proto_rawDescOnce.Do(func() {
|
||||
file_events_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)))
|
||||
})
|
||||
return file_events_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_events_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_events_proto_goTypes = []any{
|
||||
(EventType)(0), // 0: events.EventType
|
||||
(*Event)(nil), // 1: events.Event
|
||||
(*SlugChangeEvent)(nil), // 2: events.SlugChangeEvent
|
||||
(*emptypb.Empty)(nil), // 3: google.protobuf.Empty
|
||||
}
|
||||
var file_events_proto_depIdxs = []int32{
|
||||
0, // 0: events.Event.type:type_name -> events.EventType
|
||||
2, // 1: events.Event.data_event:type_name -> events.SlugChangeEvent
|
||||
3, // 2: events.EventService.Subscribe:input_type -> google.protobuf.Empty
|
||||
1, // 3: events.EventService.Subscribe:output_type -> events.Event
|
||||
3, // [3:4] is the sub-list for method output_type
|
||||
2, // [2:3] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_events_proto_init() }
|
||||
func file_events_proto_init() {
|
||||
if File_events_proto != nil {
|
||||
return
|
||||
}
|
||||
file_events_proto_msgTypes[0].OneofWrappers = []any{
|
||||
(*Event_DataEvent)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_events_proto_goTypes,
|
||||
DependencyIndexes: file_events_proto_depIdxs,
|
||||
EnumInfos: file_events_proto_enumTypes,
|
||||
MessageInfos: file_events_proto_msgTypes,
|
||||
}.Build()
|
||||
File_events_proto = out.File
|
||||
file_events_proto_goTypes = nil
|
||||
file_events_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user