complete rewrite to grpc
This commit is contained in:
420
proto/cart_actor.pb.go
Normal file
420
proto/cart_actor.pb.go
Normal file
@@ -0,0 +1,420 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v3.21.12
|
||||
// source: cart_actor.proto
|
||||
|
||||
package messages
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
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)
|
||||
)
|
||||
|
||||
// MutationType corresponds 1:1 with the legacy uint16 message type constants.
|
||||
type MutationType int32
|
||||
|
||||
const (
|
||||
MutationType_MUTATION_TYPE_UNSPECIFIED MutationType = 0
|
||||
MutationType_MUTATION_ADD_REQUEST MutationType = 1
|
||||
MutationType_MUTATION_ADD_ITEM MutationType = 2
|
||||
// (3 was unused / reserved in legacy framing)
|
||||
MutationType_MUTATION_REMOVE_ITEM MutationType = 4
|
||||
MutationType_MUTATION_REMOVE_DELIVERY MutationType = 5
|
||||
MutationType_MUTATION_CHANGE_QUANTITY MutationType = 6
|
||||
MutationType_MUTATION_SET_DELIVERY MutationType = 7
|
||||
MutationType_MUTATION_SET_PICKUP_POINT MutationType = 8
|
||||
MutationType_MUTATION_CREATE_CHECKOUT_ORDER MutationType = 9
|
||||
MutationType_MUTATION_SET_CART_ITEMS MutationType = 10
|
||||
MutationType_MUTATION_ORDER_COMPLETED MutationType = 11
|
||||
)
|
||||
|
||||
// Enum value maps for MutationType.
|
||||
var (
|
||||
MutationType_name = map[int32]string{
|
||||
0: "MUTATION_TYPE_UNSPECIFIED",
|
||||
1: "MUTATION_ADD_REQUEST",
|
||||
2: "MUTATION_ADD_ITEM",
|
||||
4: "MUTATION_REMOVE_ITEM",
|
||||
5: "MUTATION_REMOVE_DELIVERY",
|
||||
6: "MUTATION_CHANGE_QUANTITY",
|
||||
7: "MUTATION_SET_DELIVERY",
|
||||
8: "MUTATION_SET_PICKUP_POINT",
|
||||
9: "MUTATION_CREATE_CHECKOUT_ORDER",
|
||||
10: "MUTATION_SET_CART_ITEMS",
|
||||
11: "MUTATION_ORDER_COMPLETED",
|
||||
}
|
||||
MutationType_value = map[string]int32{
|
||||
"MUTATION_TYPE_UNSPECIFIED": 0,
|
||||
"MUTATION_ADD_REQUEST": 1,
|
||||
"MUTATION_ADD_ITEM": 2,
|
||||
"MUTATION_REMOVE_ITEM": 4,
|
||||
"MUTATION_REMOVE_DELIVERY": 5,
|
||||
"MUTATION_CHANGE_QUANTITY": 6,
|
||||
"MUTATION_SET_DELIVERY": 7,
|
||||
"MUTATION_SET_PICKUP_POINT": 8,
|
||||
"MUTATION_CREATE_CHECKOUT_ORDER": 9,
|
||||
"MUTATION_SET_CART_ITEMS": 10,
|
||||
"MUTATION_ORDER_COMPLETED": 11,
|
||||
}
|
||||
)
|
||||
|
||||
func (x MutationType) Enum() *MutationType {
|
||||
p := new(MutationType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x MutationType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (MutationType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_cart_actor_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (MutationType) Type() protoreflect.EnumType {
|
||||
return &file_cart_actor_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x MutationType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MutationType.Descriptor instead.
|
||||
func (MutationType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// MutationRequest is an envelope:
|
||||
// - cart_id: string form of CartId (legacy 16-byte array truncated/padded).
|
||||
// - type: mutation kind (see enum).
|
||||
// - payload: serialized underlying proto message (AddRequest, AddItem, etc.).
|
||||
// - client_timestamp: optional unix timestamp; server sets if zero.
|
||||
type MutationRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CartId string `protobuf:"bytes,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
|
||||
Type MutationType `protobuf:"varint,2,opt,name=type,proto3,enum=messages.MutationType" json:"type,omitempty"`
|
||||
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
ClientTimestamp int64 `protobuf:"varint,4,opt,name=client_timestamp,json=clientTimestamp,proto3" json:"client_timestamp,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *MutationRequest) Reset() {
|
||||
*x = MutationRequest{}
|
||||
mi := &file_cart_actor_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *MutationRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MutationRequest) ProtoMessage() {}
|
||||
|
||||
func (x *MutationRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cart_actor_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 MutationRequest.ProtoReflect.Descriptor instead.
|
||||
func (*MutationRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MutationRequest) GetCartId() string {
|
||||
if x != nil {
|
||||
return x.CartId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MutationRequest) GetType() MutationType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MutationType_MUTATION_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *MutationRequest) GetPayload() []byte {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MutationRequest) GetClientTimestamp() int64 {
|
||||
if x != nil {
|
||||
return x.ClientTimestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// MutationReply returns a status code (legacy semantics) plus a JSON payload
|
||||
// representing the full cart state (or an error message if non-200).
|
||||
type MutationReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
|
||||
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // JSON cart state or error string
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *MutationReply) Reset() {
|
||||
*x = MutationReply{}
|
||||
mi := &file_cart_actor_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *MutationReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MutationReply) ProtoMessage() {}
|
||||
|
||||
func (x *MutationReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cart_actor_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 MutationReply.ProtoReflect.Descriptor instead.
|
||||
func (*MutationReply) Descriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *MutationReply) GetStatusCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MutationReply) GetPayload() []byte {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// StateRequest fetches current cart state without mutation.
|
||||
type StateRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CartId string `protobuf:"bytes,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StateRequest) Reset() {
|
||||
*x = StateRequest{}
|
||||
mi := &file_cart_actor_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StateRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StateRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StateRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cart_actor_proto_msgTypes[2]
|
||||
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 StateRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StateRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *StateRequest) GetCartId() string {
|
||||
if x != nil {
|
||||
return x.CartId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// StateReply mirrors MutationReply for consistency.
|
||||
type StateReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
|
||||
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // JSON cart state or error string
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StateReply) Reset() {
|
||||
*x = StateReply{}
|
||||
mi := &file_cart_actor_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StateReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StateReply) ProtoMessage() {}
|
||||
|
||||
func (x *StateReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cart_actor_proto_msgTypes[3]
|
||||
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 StateReply.ProtoReflect.Descriptor instead.
|
||||
func (*StateReply) Descriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *StateReply) GetStatusCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StateReply) GetPayload() []byte {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_cart_actor_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_cart_actor_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x10cart_actor.proto\x12\bmessages\"\x9b\x01\n" +
|
||||
"\x0fMutationRequest\x12\x17\n" +
|
||||
"\acart_id\x18\x01 \x01(\tR\x06cartId\x12*\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x16.messages.MutationTypeR\x04type\x12\x18\n" +
|
||||
"\apayload\x18\x03 \x01(\fR\apayload\x12)\n" +
|
||||
"\x10client_timestamp\x18\x04 \x01(\x03R\x0fclientTimestamp\"J\n" +
|
||||
"\rMutationReply\x12\x1f\n" +
|
||||
"\vstatus_code\x18\x01 \x01(\x05R\n" +
|
||||
"statusCode\x12\x18\n" +
|
||||
"\apayload\x18\x02 \x01(\fR\apayload\"'\n" +
|
||||
"\fStateRequest\x12\x17\n" +
|
||||
"\acart_id\x18\x01 \x01(\tR\x06cartId\"G\n" +
|
||||
"\n" +
|
||||
"StateReply\x12\x1f\n" +
|
||||
"\vstatus_code\x18\x01 \x01(\x05R\n" +
|
||||
"statusCode\x12\x18\n" +
|
||||
"\apayload\x18\x02 \x01(\fR\apayload*\xcd\x02\n" +
|
||||
"\fMutationType\x12\x1d\n" +
|
||||
"\x19MUTATION_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" +
|
||||
"\x14MUTATION_ADD_REQUEST\x10\x01\x12\x15\n" +
|
||||
"\x11MUTATION_ADD_ITEM\x10\x02\x12\x18\n" +
|
||||
"\x14MUTATION_REMOVE_ITEM\x10\x04\x12\x1c\n" +
|
||||
"\x18MUTATION_REMOVE_DELIVERY\x10\x05\x12\x1c\n" +
|
||||
"\x18MUTATION_CHANGE_QUANTITY\x10\x06\x12\x19\n" +
|
||||
"\x15MUTATION_SET_DELIVERY\x10\a\x12\x1d\n" +
|
||||
"\x19MUTATION_SET_PICKUP_POINT\x10\b\x12\"\n" +
|
||||
"\x1eMUTATION_CREATE_CHECKOUT_ORDER\x10\t\x12\x1b\n" +
|
||||
"\x17MUTATION_SET_CART_ITEMS\x10\n" +
|
||||
"\x12\x1c\n" +
|
||||
"\x18MUTATION_ORDER_COMPLETED\x10\v2\x83\x01\n" +
|
||||
"\tCartActor\x12<\n" +
|
||||
"\x06Mutate\x12\x19.messages.MutationRequest\x1a\x17.messages.MutationReply\x128\n" +
|
||||
"\bGetState\x12\x16.messages.StateRequest\x1a\x14.messages.StateReplyB\fZ\n" +
|
||||
".;messagesb\x06proto3"
|
||||
|
||||
var (
|
||||
file_cart_actor_proto_rawDescOnce sync.Once
|
||||
file_cart_actor_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_cart_actor_proto_rawDescGZIP() []byte {
|
||||
file_cart_actor_proto_rawDescOnce.Do(func() {
|
||||
file_cart_actor_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cart_actor_proto_rawDesc), len(file_cart_actor_proto_rawDesc)))
|
||||
})
|
||||
return file_cart_actor_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_cart_actor_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_cart_actor_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_cart_actor_proto_goTypes = []any{
|
||||
(MutationType)(0), // 0: messages.MutationType
|
||||
(*MutationRequest)(nil), // 1: messages.MutationRequest
|
||||
(*MutationReply)(nil), // 2: messages.MutationReply
|
||||
(*StateRequest)(nil), // 3: messages.StateRequest
|
||||
(*StateReply)(nil), // 4: messages.StateReply
|
||||
}
|
||||
var file_cart_actor_proto_depIdxs = []int32{
|
||||
0, // 0: messages.MutationRequest.type:type_name -> messages.MutationType
|
||||
1, // 1: messages.CartActor.Mutate:input_type -> messages.MutationRequest
|
||||
3, // 2: messages.CartActor.GetState:input_type -> messages.StateRequest
|
||||
2, // 3: messages.CartActor.Mutate:output_type -> messages.MutationReply
|
||||
4, // 4: messages.CartActor.GetState:output_type -> messages.StateReply
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] 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_cart_actor_proto_init() }
|
||||
func file_cart_actor_proto_init() {
|
||||
if File_cart_actor_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_cart_actor_proto_rawDesc), len(file_cart_actor_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_cart_actor_proto_goTypes,
|
||||
DependencyIndexes: file_cart_actor_proto_depIdxs,
|
||||
EnumInfos: file_cart_actor_proto_enumTypes,
|
||||
MessageInfos: file_cart_actor_proto_msgTypes,
|
||||
}.Build()
|
||||
File_cart_actor_proto = out.File
|
||||
file_cart_actor_proto_goTypes = nil
|
||||
file_cart_actor_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user