فهرست منبع

proto

- update protobuf dependency
- Action: refactoring
Alexey Kim 5 روز پیش
والد
کامیت
b361e1f155
6فایلهای تغییر یافته به همراه73 افزوده شده و 132 حذف شده
  1. 0 1
      Makefile
  2. 1 1
      go.mod
  3. 2 0
      go.sum
  4. 53 120
      probability.pb.go
  5. 2 5
      proto/probability.proto
  6. 15 5
      proto/probability_pb2.py

+ 0 - 1
Makefile

@@ -2,7 +2,6 @@
 .DELETE_ON_ERROR:
 .SUFFIXES:
 
-include .env
 export
 
 PROJECT := $(shell cat go.mod | grep '^module\s' | cut -b 8-)

+ 1 - 1
go.mod

@@ -2,4 +2,4 @@ module git.beejay.kim/Gshopper/sentio
 
 go 1.22.2
 
-require google.golang.org/protobuf v1.36.5
+require google.golang.org/protobuf v1.36.6

+ 2 - 0
go.sum

@@ -4,3 +4,5 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IV
 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=
+google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
+google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=

+ 53 - 120
probability.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.32.0
-// 	protoc        v4.25.1
+// 	protoc-gen-go v1.36.6
+// 	protoc        v5.29.3
 // source: proto/probability.proto
 
 package sentio
@@ -12,6 +12,7 @@ import (
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
 	reflect "reflect"
 	sync "sync"
+	unsafe "unsafe"
 )
 
 const (
@@ -24,28 +25,19 @@ const (
 type Action int32
 
 const (
-	Action_DOUBLE_SELL Action = 0
-	Action_SELL        Action = 1
-	Action_HOLD        Action = 2
-	Action_BUY         Action = 3
-	Action_DOUBLE_BUY  Action = 4
+	Action_SELL Action = 0
+	Action_BUY  Action = 1
 )
 
 // Enum value maps for Action.
 var (
 	Action_name = map[int32]string{
-		0: "DOUBLE_SELL",
-		1: "SELL",
-		2: "HOLD",
-		3: "BUY",
-		4: "DOUBLE_BUY",
+		0: "SELL",
+		1: "BUY",
 	}
 	Action_value = map[string]int32{
-		"DOUBLE_SELL": 0,
-		"SELL":        1,
-		"HOLD":        2,
-		"BUY":         3,
-		"DOUBLE_BUY":  4,
+		"SELL": 0,
+		"BUY":  1,
 	}
 )
 
@@ -77,20 +69,17 @@ func (Action) EnumDescriptor() ([]byte, []int) {
 }
 
 type Probability struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
+	state         protoimpl.MessageState `protogen:"open.v1"`
+	Stamps        []*Probability_Stamp   `protobuf:"bytes,10,rep,name=stamps,proto3" json:"stamps,omitempty"`
 	unknownFields protoimpl.UnknownFields
-
-	Stamps []*Probability_Stamp `protobuf:"bytes,10,rep,name=stamps,proto3" json:"stamps,omitempty"`
+	sizeCache     protoimpl.SizeCache
 }
 
 func (x *Probability) Reset() {
 	*x = Probability{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_proto_probability_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
+	mi := &file_proto_probability_proto_msgTypes[0]
+	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+	ms.StoreMessageInfo(mi)
 }
 
 func (x *Probability) String() string {
@@ -101,7 +90,7 @@ func (*Probability) ProtoMessage() {}
 
 func (x *Probability) ProtoReflect() protoreflect.Message {
 	mi := &file_proto_probability_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
+	if x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
 			ms.StoreMessageInfo(mi)
@@ -124,21 +113,18 @@ func (x *Probability) GetStamps() []*Probability_Stamp {
 }
 
 type Turn struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
+	state         protoimpl.MessageState `protogen:"open.v1"`
+	Time          *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
+	Action        Action                 `protobuf:"varint,2,opt,name=action,proto3,enum=sentio.Action" json:"action,omitempty"`
 	unknownFields protoimpl.UnknownFields
-
-	Time   *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
-	Action Action                 `protobuf:"varint,2,opt,name=action,proto3,enum=sentio.Action" json:"action,omitempty"`
+	sizeCache     protoimpl.SizeCache
 }
 
 func (x *Turn) Reset() {
 	*x = Turn{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_proto_probability_proto_msgTypes[1]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
+	mi := &file_proto_probability_proto_msgTypes[1]
+	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+	ms.StoreMessageInfo(mi)
 }
 
 func (x *Turn) String() string {
@@ -149,7 +135,7 @@ func (*Turn) ProtoMessage() {}
 
 func (x *Turn) ProtoReflect() protoreflect.Message {
 	mi := &file_proto_probability_proto_msgTypes[1]
-	if protoimpl.UnsafeEnabled && x != nil {
+	if x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
 			ms.StoreMessageInfo(mi)
@@ -175,25 +161,22 @@ func (x *Turn) GetAction() Action {
 	if x != nil {
 		return x.Action
 	}
-	return Action_DOUBLE_SELL
+	return Action_SELL
 }
 
 type Probability_Stamp struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
+	state         protoimpl.MessageState `protogen:"open.v1"`
+	Time          *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
+	Value         float32                `protobuf:"fixed32,2,opt,name=value,proto3" json:"value,omitempty"`
 	unknownFields protoimpl.UnknownFields
-
-	Time  *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
-	Value float32                `protobuf:"fixed32,2,opt,name=value,proto3" json:"value,omitempty"`
+	sizeCache     protoimpl.SizeCache
 }
 
 func (x *Probability_Stamp) Reset() {
 	*x = Probability_Stamp{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_proto_probability_proto_msgTypes[2]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
+	mi := &file_proto_probability_proto_msgTypes[2]
+	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+	ms.StoreMessageInfo(mi)
 }
 
 func (x *Probability_Stamp) String() string {
@@ -204,7 +187,7 @@ func (*Probability_Stamp) ProtoMessage() {}
 
 func (x *Probability_Stamp) ProtoReflect() protoreflect.Message {
 	mi := &file_proto_probability_proto_msgTypes[2]
-	if protoimpl.UnsafeEnabled && x != nil {
+	if x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
 			ms.StoreMessageInfo(mi)
@@ -235,49 +218,38 @@ func (x *Probability_Stamp) GetValue() float32 {
 
 var File_proto_probability_proto protoreflect.FileDescriptor
 
-var file_proto_probability_proto_rawDesc = []byte{
-	0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c,
-	0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x69,
-	0x6f, 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, 0x8f, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69,
-	0x74, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03,
-	0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x62,
-	0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, 0x73,
-	0x74, 0x61, 0x6d, 0x70, 0x73, 0x1a, 0x4d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e,
-	0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 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, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14,
-	0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76,
-	0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x04, 0x54, 0x75, 0x72, 0x6e, 0x12, 0x2e, 0x0a, 0x04,
-	0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 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, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06,
-	0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x73,
-	0x65, 0x6e, 0x74, 0x69, 0x6f, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63,
-	0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x46, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f,
-	0x0a, 0x0b, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x45, 0x4c, 0x4c, 0x10, 0x00, 0x12,
-	0x08, 0x0a, 0x04, 0x53, 0x45, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x4c,
-	0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x55, 0x59, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a,
-	0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x42, 0x55, 0x59, 0x10, 0x04, 0x42, 0x0a, 0x5a, 0x08,
-	0x2e, 0x2f, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_proto_probability_proto_rawDesc = "" +
+	"\n" +
+	"\x17proto/probability.proto\x12\x06sentio\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x01\n" +
+	"\vProbability\x121\n" +
+	"\x06stamps\x18\n" +
+	" \x03(\v2\x19.sentio.Probability.StampR\x06stamps\x1aM\n" +
+	"\x05Stamp\x12.\n" +
+	"\x04time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x12\x14\n" +
+	"\x05value\x18\x02 \x01(\x02R\x05value\"^\n" +
+	"\x04Turn\x12.\n" +
+	"\x04time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x12&\n" +
+	"\x06action\x18\x02 \x01(\x0e2\x0e.sentio.ActionR\x06action*\x1b\n" +
+	"\x06Action\x12\b\n" +
+	"\x04SELL\x10\x00\x12\a\n" +
+	"\x03BUY\x10\x01B\n" +
+	"Z\b./sentiob\x06proto3"
 
 var (
 	file_proto_probability_proto_rawDescOnce sync.Once
-	file_proto_probability_proto_rawDescData = file_proto_probability_proto_rawDesc
+	file_proto_probability_proto_rawDescData []byte
 )
 
 func file_proto_probability_proto_rawDescGZIP() []byte {
 	file_proto_probability_proto_rawDescOnce.Do(func() {
-		file_proto_probability_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_probability_proto_rawDescData)
+		file_proto_probability_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_probability_proto_rawDesc), len(file_proto_probability_proto_rawDesc)))
 	})
 	return file_proto_probability_proto_rawDescData
 }
 
 var file_proto_probability_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
 var file_proto_probability_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
-var file_proto_probability_proto_goTypes = []interface{}{
+var file_proto_probability_proto_goTypes = []any{
 	(Action)(0),                   // 0: sentio.Action
 	(*Probability)(nil),           // 1: sentio.Probability
 	(*Turn)(nil),                  // 2: sentio.Turn
@@ -301,49 +273,11 @@ func file_proto_probability_proto_init() {
 	if File_proto_probability_proto != nil {
 		return
 	}
-	if !protoimpl.UnsafeEnabled {
-		file_proto_probability_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Probability); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_proto_probability_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Turn); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_proto_probability_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Probability_Stamp); 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_probability_proto_rawDesc,
+			RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_probability_proto_rawDesc), len(file_proto_probability_proto_rawDesc)),
 			NumEnums:      1,
 			NumMessages:   3,
 			NumExtensions: 0,
@@ -355,7 +289,6 @@ func file_proto_probability_proto_init() {
 		MessageInfos:      file_proto_probability_proto_msgTypes,
 	}.Build()
 	File_proto_probability_proto = out.File
-	file_proto_probability_proto_rawDesc = nil
 	file_proto_probability_proto_goTypes = nil
 	file_proto_probability_proto_depIdxs = nil
 }

+ 2 - 5
proto/probability.proto

@@ -14,11 +14,8 @@ message Probability {
 }
 
 enum Action {
-    DOUBLE_SELL = 0;
-    SELL = 1;
-    HOLD = 2;
-    BUY = 3;
-    DOUBLE_BUY = 4;
+  SELL = 0;
+  BUY = 1;
 }
 
 message Turn {

+ 15 - 5
proto/probability_pb2.py

@@ -1,12 +1,22 @@
 # -*- coding: utf-8 -*-
 # Generated by the protocol buffer compiler.  DO NOT EDIT!
+# NO CHECKED-IN PROTOBUF GENCODE
 # source: proto/probability.proto
-# Protobuf Python Version: 4.25.1
+# Protobuf Python Version: 5.29.3
 """Generated protocol buffer code."""
 from google.protobuf import descriptor as _descriptor
 from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import runtime_version as _runtime_version
 from google.protobuf import symbol_database as _symbol_database
 from google.protobuf.internal import builder as _builder
+_runtime_version.ValidateProtobufRuntimeVersion(
+    _runtime_version.Domain.PUBLIC,
+    5,
+    29,
+    3,
+    '',
+    'proto/probability.proto'
+)
 # @@protoc_insertion_point(imports)
 
 _sym_db = _symbol_database.Default()
@@ -15,16 +25,16 @@ _sym_db = _symbol_database.Default()
 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
 
 
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17proto/probability.proto\x12\x06sentio\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x01\n\x0bProbability\x12\x31\n\x06stamps\x18\n \x03(\x0b\x32\x19.sentio.Probability.StampR\x06stamps\x1aM\n\x05Stamp\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x14\n\x05value\x18\x02 \x01(\x02R\x05value\"^\n\x04Turn\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12&\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x0e.sentio.ActionR\x06\x61\x63tion*F\n\x06\x41\x63tion\x12\x0f\n\x0b\x44OUBLE_SELL\x10\x00\x12\x08\n\x04SELL\x10\x01\x12\x08\n\x04HOLD\x10\x02\x12\x07\n\x03\x42UY\x10\x03\x12\x0e\n\nDOUBLE_BUY\x10\x04\x42\nZ\x08./sentiob\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17proto/probability.proto\x12\x06sentio\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x01\n\x0bProbability\x12\x31\n\x06stamps\x18\n \x03(\x0b\x32\x19.sentio.Probability.StampR\x06stamps\x1aM\n\x05Stamp\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x14\n\x05value\x18\x02 \x01(\x02R\x05value\"^\n\x04Turn\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12&\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x0e.sentio.ActionR\x06\x61\x63tion*\x1b\n\x06\x41\x63tion\x12\x08\n\x04SELL\x10\x00\x12\x07\n\x03\x42UY\x10\x01\x42\nZ\x08./sentiob\x06proto3')
 
 _globals = globals()
 _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
 _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.probability_pb2', _globals)
-if _descriptor._USE_C_DESCRIPTORS == False:
-  _globals['DESCRIPTOR']._options = None
+if not _descriptor._USE_C_DESCRIPTORS:
+  _globals['DESCRIPTOR']._loaded_options = None
   _globals['DESCRIPTOR']._serialized_options = b'Z\010./sentio'
   _globals['_ACTION']._serialized_start=310
-  _globals['_ACTION']._serialized_end=380
+  _globals['_ACTION']._serialized_end=337
   _globals['_PROBABILITY']._serialized_start=69
   _globals['_PROBABILITY']._serialized_end=212
   _globals['_PROBABILITY_STAMP']._serialized_start=135