From 45f17e6c50eaa4a6df7036556759d08074e10e4e Mon Sep 17 00:00:00 2001 From: w-h-a Date: Sun, 14 Jul 2024 15:16:59 -0700 Subject: [PATCH] feat: add cron proto --- Makefile | 4 ++ proto/cron/cron.pb.go | 143 ++++++++++++++++++++++++++++++++++++++++++ proto/cron/cron.proto | 10 +++ 3 files changed, 157 insertions(+) create mode 100644 proto/cron/cron.pb.go create mode 100644 proto/cron/cron.proto diff --git a/Makefile b/Makefile index 9c2fd76..cf8bee0 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ proto-runtime: proto-streams: protoc proto/streams/*.proto --go_out=paths=source_relative:. --proto_path=. +.PHONY: proto-cron +proto-cron: + protoc proto/cron/*.proto --go_out=paths=source_relative:. --proto_path=. + .PHONY: proto-ticket proto-ticket: protoc proto/ticket/*.proto --go_out=paths=source_relative:. --proto_path=. diff --git a/proto/cron/cron.pb.go b/proto/cron/cron.pb.go new file mode 100644 index 0000000..4149950 --- /dev/null +++ b/proto/cron/cron.pb.go @@ -0,0 +1,143 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.9 +// source: proto/cron/cron.proto + +package cron + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// domain +type Job struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *Job) Reset() { + *x = Job{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_cron_cron_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Job) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Job) ProtoMessage() {} + +func (x *Job) ProtoReflect() protoreflect.Message { + mi := &file_proto_cron_cron_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 Job.ProtoReflect.Descriptor instead. +func (*Job) Descriptor() ([]byte, []int) { + return file_proto_cron_cron_proto_rawDescGZIP(), []int{0} +} + +func (x *Job) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_proto_cron_cron_proto protoreflect.FileDescriptor + +var file_proto_cron_cron_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x2f, 0x63, 0x72, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x22, 0x15, 0x0a, + 0x03, 0x4a, 0x6f, 0x62, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x77, 0x2d, 0x68, 0x2d, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_cron_cron_proto_rawDescOnce sync.Once + file_proto_cron_cron_proto_rawDescData = file_proto_cron_cron_proto_rawDesc +) + +func file_proto_cron_cron_proto_rawDescGZIP() []byte { + file_proto_cron_cron_proto_rawDescOnce.Do(func() { + file_proto_cron_cron_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_cron_cron_proto_rawDescData) + }) + return file_proto_cron_cron_proto_rawDescData +} + +var file_proto_cron_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_proto_cron_cron_proto_goTypes = []interface{}{ + (*Job)(nil), // 0: cron.Job +} +var file_proto_cron_cron_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_cron_cron_proto_init() } +func file_proto_cron_cron_proto_init() { + if File_proto_cron_cron_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_cron_cron_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Job); 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_proto_cron_cron_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_cron_cron_proto_goTypes, + DependencyIndexes: file_proto_cron_cron_proto_depIdxs, + MessageInfos: file_proto_cron_cron_proto_msgTypes, + }.Build() + File_proto_cron_cron_proto = out.File + file_proto_cron_cron_proto_rawDesc = nil + file_proto_cron_cron_proto_goTypes = nil + file_proto_cron_cron_proto_depIdxs = nil +} diff --git a/proto/cron/cron.proto b/proto/cron/cron.proto new file mode 100644 index 0000000..fbddea7 --- /dev/null +++ b/proto/cron/cron.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package cron; + +option go_package = "github.com/w-h-a/pkg/proto/cron"; + +// domain +message Job { + string id = 1; +} \ No newline at end of file