Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,472 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.14.0
// source: protobufs/authentication.proto
package authentication
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)
)
type AuthToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
Roles string `protobuf:"bytes,2,opt,name=roles,proto3" json:"roles,omitempty"`
}
func (x *AuthToken) Reset() {
*x = AuthToken{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthToken) ProtoMessage() {}
func (x *AuthToken) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 AuthToken.ProtoReflect.Descriptor instead.
func (*AuthToken) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{0}
}
func (x *AuthToken) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *AuthToken) GetRoles() string {
if x != nil {
return x.Roles
}
return ""
}
type AuthCode struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
Redirect string `protobuf:"bytes,2,opt,name=redirect,proto3" json:"redirect,omitempty"`
}
func (x *AuthCode) Reset() {
*x = AuthCode{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthCode) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthCode) ProtoMessage() {}
func (x *AuthCode) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_proto_msgTypes[1]
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 AuthCode.ProtoReflect.Descriptor instead.
func (*AuthCode) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{1}
}
func (x *AuthCode) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *AuthCode) GetRedirect() string {
if x != nil {
return x.Redirect
}
return ""
}
type AuthJWT struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Jwt string `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"`
}
func (x *AuthJWT) Reset() {
*x = AuthJWT{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthJWT) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthJWT) ProtoMessage() {}
func (x *AuthJWT) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_proto_msgTypes[2]
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 AuthJWT.ProtoReflect.Descriptor instead.
func (*AuthJWT) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{2}
}
func (x *AuthJWT) GetJwt() string {
if x != nil {
return x.Jwt
}
return ""
}
type AuthTokens struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AccessToken *AuthJWT `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
IdToken *AuthJWT `protobuf:"bytes,2,opt,name=idToken,proto3" json:"idToken,omitempty"`
RefreshToken *AuthToken `protobuf:"bytes,3,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
}
func (x *AuthTokens) Reset() {
*x = AuthTokens{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthTokens) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthTokens) ProtoMessage() {}
func (x *AuthTokens) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_proto_msgTypes[3]
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 AuthTokens.ProtoReflect.Descriptor instead.
func (*AuthTokens) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{3}
}
func (x *AuthTokens) GetAccessToken() *AuthJWT {
if x != nil {
return x.AccessToken
}
return nil
}
func (x *AuthTokens) GetIdToken() *AuthJWT {
if x != nil {
return x.IdToken
}
return nil
}
func (x *AuthTokens) GetRefreshToken() *AuthToken {
if x != nil {
return x.RefreshToken
}
return nil
}
type ValidationResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *ValidationResult) Reset() {
*x = ValidationResult{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ValidationResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ValidationResult) ProtoMessage() {}
func (x *ValidationResult) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_proto_msgTypes[4]
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 ValidationResult.ProtoReflect.Descriptor instead.
func (*ValidationResult) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{4}
}
func (x *ValidationResult) GetValid() bool {
if x != nil {
return x.Valid
}
return false
}
func (x *ValidationResult) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
var File_protobufs_authentication_proto protoreflect.FileDescriptor
var file_protobufs_authentication_proto_rawDesc = []byte{
0x0a, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68,
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x37, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x3a, 0x0a, 0x08, 0x41, 0x75, 0x74,
0x68, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x22, 0x1b, 0x0a, 0x07, 0x41, 0x75, 0x74, 0x68, 0x4a, 0x57, 0x54,
0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a,
0x77, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4a, 0x57, 0x54, 0x52,
0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x31, 0x0a, 0x07,
0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41,
0x75, 0x74, 0x68, 0x4a, 0x57, 0x54, 0x52, 0x07, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
0x3d, 0x0a, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x42,
0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x32, 0xed, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x43, 0x6f, 0x64, 0x65, 0x1a, 0x1a, 0x2e, 0x61,
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75,
0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0d, 0x52, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x75,
0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74,
0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x20,
0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x66, 0x69, 0x73, 0x6b, 0x65, 0x72, 0x69, 0x6e, 0x63, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63,
0x2f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_protobufs_authentication_proto_rawDescOnce sync.Once
file_protobufs_authentication_proto_rawDescData = file_protobufs_authentication_proto_rawDesc
)
func file_protobufs_authentication_proto_rawDescGZIP() []byte {
file_protobufs_authentication_proto_rawDescOnce.Do(func() {
file_protobufs_authentication_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobufs_authentication_proto_rawDescData)
})
return file_protobufs_authentication_proto_rawDescData
}
var file_protobufs_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_protobufs_authentication_proto_goTypes = []interface{}{
(*AuthToken)(nil), // 0: authentication.AuthToken
(*AuthCode)(nil), // 1: authentication.AuthCode
(*AuthJWT)(nil), // 2: authentication.AuthJWT
(*AuthTokens)(nil), // 3: authentication.AuthTokens
(*ValidationResult)(nil), // 4: authentication.ValidationResult
}
var file_protobufs_authentication_proto_depIdxs = []int32{
2, // 0: authentication.AuthTokens.accessToken:type_name -> authentication.AuthJWT
2, // 1: authentication.AuthTokens.idToken:type_name -> authentication.AuthJWT
0, // 2: authentication.AuthTokens.refreshToken:type_name -> authentication.AuthToken
1, // 3: authentication.Authentication.GetTokens:input_type -> authentication.AuthCode
0, // 4: authentication.Authentication.RefreshTokens:input_type -> authentication.AuthToken
0, // 5: authentication.Authentication.VerifyToken:input_type -> authentication.AuthToken
3, // 6: authentication.Authentication.GetTokens:output_type -> authentication.AuthTokens
3, // 7: authentication.Authentication.RefreshTokens:output_type -> authentication.AuthTokens
4, // 8: authentication.Authentication.VerifyToken:output_type -> authentication.ValidationResult
6, // [6:9] is the sub-list for method output_type
3, // [3:6] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_protobufs_authentication_proto_init() }
func file_protobufs_authentication_proto_init() {
if File_protobufs_authentication_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_protobufs_authentication_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthToken); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthCode); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthJWT); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthTokens); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ValidationResult); 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_protobufs_authentication_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_protobufs_authentication_proto_goTypes,
DependencyIndexes: file_protobufs_authentication_proto_depIdxs,
MessageInfos: file_protobufs_authentication_proto_msgTypes,
}.Build()
File_protobufs_authentication_proto = out.File
file_protobufs_authentication_proto_rawDesc = nil
file_protobufs_authentication_proto_goTypes = nil
file_protobufs_authentication_proto_depIdxs = nil
}

View File

@@ -0,0 +1,173 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package authentication
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AuthenticationClient is the client API for Authentication service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AuthenticationClient interface {
GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error)
RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error)
VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error)
}
type authenticationClient struct {
cc grpc.ClientConnInterface
}
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient {
return &authenticationClient{cc}
}
func (c *authenticationClient) GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error) {
out := new(AuthTokens)
err := c.cc.Invoke(ctx, "/authentication.Authentication/GetTokens", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authenticationClient) RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error) {
out := new(AuthTokens)
err := c.cc.Invoke(ctx, "/authentication.Authentication/RefreshTokens", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authenticationClient) VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error) {
out := new(ValidationResult)
err := c.cc.Invoke(ctx, "/authentication.Authentication/VerifyToken", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthenticationServer is the server API for Authentication service.
// All implementations must embed UnimplementedAuthenticationServer
// for forward compatibility
type AuthenticationServer interface {
GetTokens(context.Context, *AuthCode) (*AuthTokens, error)
RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error)
VerifyToken(context.Context, *AuthToken) (*ValidationResult, error)
mustEmbedUnimplementedAuthenticationServer()
}
// UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.
type UnimplementedAuthenticationServer struct {
}
func (UnimplementedAuthenticationServer) GetTokens(context.Context, *AuthCode) (*AuthTokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTokens not implemented")
}
func (UnimplementedAuthenticationServer) RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method RefreshTokens not implemented")
}
func (UnimplementedAuthenticationServer) VerifyToken(context.Context, *AuthToken) (*ValidationResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyToken not implemented")
}
func (UnimplementedAuthenticationServer) mustEmbedUnimplementedAuthenticationServer() {}
// UnsafeAuthenticationServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthenticationServer will
// result in compilation errors.
type UnsafeAuthenticationServer interface {
mustEmbedUnimplementedAuthenticationServer()
}
func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer) {
s.RegisterService(&Authentication_ServiceDesc, srv)
}
func _Authentication_GetTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthCode)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).GetTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/GetTokens",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).GetTokens(ctx, req.(*AuthCode))
}
return interceptor(ctx, in, info, handler)
}
func _Authentication_RefreshTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthToken)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).RefreshTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/RefreshTokens",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).RefreshTokens(ctx, req.(*AuthToken))
}
return interceptor(ctx, in, info, handler)
}
func _Authentication_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthToken)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).VerifyToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/VerifyToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).VerifyToken(ctx, req.(*AuthToken))
}
return interceptor(ctx, in, info, handler)
}
// Authentication_ServiceDesc is the grpc.ServiceDesc for Authentication service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Authentication_ServiceDesc = grpc.ServiceDesc{
ServiceName: "authentication.Authentication",
HandlerType: (*AuthenticationServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetTokens",
Handler: _Authentication_GetTokens_Handler,
},
{
MethodName: "RefreshTokens",
Handler: _Authentication_RefreshTokens_Handler,
},
{
MethodName: "VerifyToken",
Handler: _Authentication_VerifyToken_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "protobufs/authentication.proto",
}

39
pkg/grpc/gen-proto.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
cd ../
protoc \
-I=grpc \
-I=grpc/sms \
--go_out=. \
--go-grpc_out=. \
grpc/sms/sms.proto && \
echo "Generated grpc/sms/sms.pb.go" && \
echo "Generated grpc/sms/sms_grpc.pb.go"
protoc \
-I=grpc \
-I=grpc/kafka_grpc \
--go_out=. \
--go-grpc_out=. \
grpc/kafka_grpc/vehicle_data.proto && \
echo "Generated grpc/kafka_grpc/vehicle_data.pb.go" && \
echo "Generated grpc/kafka_grpc/vehicle_data.pb.go"
protoc \
-I=grpc \
-I=grpc/kafka_grpc \
--go_out=. \
--go-grpc_out=. \
grpc/kafka_grpc/vehicle_signal.proto && \
echo "Generated grpc/kafka_grpc/vehicle_signal.pb.go" && \
echo "Generated grpc/kafka_grpc/vehicle_signal.pb.go"
protoc \
-I=grpc \
-I=grpc/kafka_grpc \
--go_out=. \
--go-grpc_out=. \
grpc/kafka_grpc/trex_log.proto && \
echo "Generated grpc/kafka_grpc/trex_log.pb.go" && \
echo "Generated grpc/kafka_grpc/trex_log.pb.go"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,250 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
enum EmumStatus {
DELIVERED = 0;
TIMEOUT = 1;
FAILED = 2;
}
enum ManifestFileType {
bootloader = 0;
software = 1;
calibration = 2;
other = 3;
}
enum CompatibleTrim {
EXTREME = 0;
ULTRA = 1;
SPORT = 2;
}
enum CompatibleDriveSide {
LEFT_HAND_DRIVE = 0;
RIGHT_HAND_DRIVE = 1;
}
message GRPC_AttendantPayload {
string handler = 1;
oneof Data {
CarUpdateStatus carUpdateStatus = 2;
CarUpdateProgress carUpdateProgress = 3;
FileKeysRequest fileKeyReq = 4;
ECCKeys keys = 5;
UpdateData updateApprove = 6;
VehicleData updateGet = 7;
UpdateManifest updateManifest = 8;
Order order = 9;
MessageStatus messageStatus = 10;
DTCEntry dtcEntry = 11;
CarUpdateRequest carUpdateRequest = 12;
}
}
message CarUpdateStatus {
map<string, CarECU> ecus = 1;
}
message CarECU {
string vin = 1;
string ecu = 2;
string sw_version = 3;
string serial_number = 4;
string hw_version = 5;
string boot_loader_version = 6;
string fingerprint = 7;
string code_data_string = 8;
string vendor = 9;
string supplier_sw_version = 10;
int64 epoch_usec = 11;
string assy_number = 12;
optional int64 createdAt = 13;
optional int64 updatedAt = 14;
}
message CarUpdateProgress {
uint64 fileCurrent = 1;
uint64 fileTotal = 2;
uint64 pkgCurrent = 3;
uint64 pkgTotal = 4;
int64 installedFiles = 5;
int64 totalFiles = 6;
int64 carUpdateID = 7;
string ecu = 8;
string info = 9;
string status = 10;
int64 errCode = 11;
}
message FileKeysRequest {
repeated string fileIDs = 1;
}
message DTCEntry {
int64 createdAt = 1;
string vin = 2;
string ecu = 3;
uint64 dtc = 4;
int64 timestamp = 5;
uint32 speed = 6;
uint32 mileage = 7;
uint32 volt = 8;
string snapshotBase64 = 9;
uint32 status = 10;
}
message ECCKeys {
repeated ECCKey eccKeys = 1;
}
message ECCKey {
string ecu = 1;
string env = 2;
optional BineryHex pub_key_level_1 = 3;
optional BineryHex pub_key_level_2 = 4;
optional BineryHex pub_key_level_3 = 5;
optional BineryHex level_1 = 6;
optional BineryHex level_2 = 7;
optional BineryHex level_3 = 8;
optional int64 created = 9;
optional int64 updated = 10;
}
message BineryHex {
bytes data = 1;
}
message UpdateData {
int64 id = 1;
}
message VehicleData {
string vin = 1;
}
message MessageStatus {
string messageId = 1;
EmumStatus status = 2;
}
message UpdateManifest {
int64 id = 1;
string name = 2;
string version = 3;
string description = 4;
string release_notes = 5;
string ecu_list = 6;
repeated UpdateManifestECU ecu_updates = 7;
string fingerprint = 8;
int64 car_update_id = 9;
bool rollback = 10;
string type = 11;
string vod = 12;
int32 manifest_type = 13;
optional bool active = 14;
string country = 15;
string powertrain = 16;
string restraint = 17;
string model = 18;
string trim = 19;
int32 year = 20;
string body_type = 21;
string sums = 22;
string env = 23;
int32 update_duration = 24;
int32 max_attempts = 25;
optional int64 created = 26;
optional int64 updated = 27;
}
message UpdateManifestECU {
int64 id = 1;
int64 manifest_id = 2;
string name = 3;
string version = 4;
string current_version = 5;
string hw_version = 6;
repeated string hw_versions = 7;
string configuration_mask = 8;
string configuration = 9;
bool self_download = 10;
string mode = 11;
repeated UpdateManifestFile files = 12;
repeated UpdateManifestECU rollback = 13;
ECCKey ecc_keys = 14;
int32 install_priority = 15;
optional int64 created = 16;
optional int64 updated = 17;
}
message UpdateManifestFile {
string file_id = 1;
int64 manifest_ecu_id = 2;
string filename = 3;
string url = 4;
uint64 file_size = 5;
string checksum = 6;
string type = 7;
int32 order = 8;
MemoryRegion write_region = 9;
MemoryRegion erase_region = 10;
FileKeyResponse file_key = 11;
optional bool parsed_file = 12;
string signature = 13;
repeated string compatible_trims = 14;
repeated string compatible_drive_sides = 15;
optional string created = 16;
optional string updated = 17;
}
message MemoryRegion {
uint64 offset = 1;
uint64 length = 2;
}
message FileKeyResponse {
string file_id = 1;
string key = 2;
string auth = 3;
string nonce = 4;
string error = 5;
}
message FeatureCodes {
string familyCode = 1;
string featureCode = 2;
}
message VehicleSpecification {
string orderId = 1; // OrderIndicator
string productId = 2; // ProductionPhaseIndicator
string vehicleId = 3; // VehicleIndicator
string mfPlant = 4; // ManufacturingPlant
string modelType = 5; // ModelType
int64 modelId = 6; // ModelYearIndicator
int64 modelYear = 7;
string sn = 8; // SequenceNumber
int64 version = 9; // VersionDuringModelYear
string model = 10; // VehicleModel
string vinPre = 11; // VinPrefix
string destCon = 12; // DestinationCountry
repeated FeatureCodes feature = 13; // VehicleFeatures
int64 date = 14; // ExpectedReferenceDate
string fOrderId = 15; // FleetOrderIndicator
}
message Order {
int64 specId = 1;
int64 orderNo = 2;
string msgIdentifier = 3;
VehicleSpecification VehicleSpecification = 4;
}
message CarUpdateRequest {
int64 car_update_id = 1;
}

View File

@@ -0,0 +1,348 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.3
// source: kafka_grpc/depot_data.proto
package kafka_grpc
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)
)
type GRPC_DepotPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Handler string `protobuf:"bytes,1,opt,name=handler,proto3" json:"handler,omitempty"`
// Types that are assignable to Data:
//
// *GRPC_DepotPayload_InitPayload
// *GRPC_DepotPayload_HmiSession
Data isGRPC_DepotPayload_Data `protobuf_oneof:"Data"`
}
func (x *GRPC_DepotPayload) Reset() {
*x = GRPC_DepotPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_depot_data_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_DepotPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_DepotPayload) ProtoMessage() {}
func (x *GRPC_DepotPayload) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_depot_data_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 GRPC_DepotPayload.ProtoReflect.Descriptor instead.
func (*GRPC_DepotPayload) Descriptor() ([]byte, []int) {
return file_kafka_grpc_depot_data_proto_rawDescGZIP(), []int{0}
}
func (x *GRPC_DepotPayload) GetHandler() string {
if x != nil {
return x.Handler
}
return ""
}
func (m *GRPC_DepotPayload) GetData() isGRPC_DepotPayload_Data {
if m != nil {
return m.Data
}
return nil
}
func (x *GRPC_DepotPayload) GetInitPayload() *InitPayload {
if x, ok := x.GetData().(*GRPC_DepotPayload_InitPayload); ok {
return x.InitPayload
}
return nil
}
func (x *GRPC_DepotPayload) GetHmiSession() *HMISessionData {
if x, ok := x.GetData().(*GRPC_DepotPayload_HmiSession); ok {
return x.HmiSession
}
return nil
}
type isGRPC_DepotPayload_Data interface {
isGRPC_DepotPayload_Data()
}
type GRPC_DepotPayload_InitPayload struct {
InitPayload *InitPayload `protobuf:"bytes,2,opt,name=initPayload,proto3,oneof"`
}
type GRPC_DepotPayload_HmiSession struct {
HmiSession *HMISessionData `protobuf:"bytes,3,opt,name=hmiSession,proto3,oneof"`
}
func (*GRPC_DepotPayload_InitPayload) isGRPC_DepotPayload_Data() {}
func (*GRPC_DepotPayload_HmiSession) isGRPC_DepotPayload_Data() {}
type InitPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data map[string]string `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *InitPayload) Reset() {
*x = InitPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_depot_data_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InitPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InitPayload) ProtoMessage() {}
func (x *InitPayload) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_depot_data_proto_msgTypes[1]
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 InitPayload.ProtoReflect.Descriptor instead.
func (*InitPayload) Descriptor() ([]byte, []int) {
return file_kafka_grpc_depot_data_proto_rawDescGZIP(), []int{1}
}
func (x *InitPayload) GetData() map[string]string {
if x != nil {
return x.Data
}
return nil
}
type HMISessionData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SessionId string `protobuf:"bytes,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"`
Salt string `protobuf:"bytes,2,opt,name=Salt,proto3" json:"Salt,omitempty"`
Vin string `protobuf:"bytes,3,opt,name=vin,proto3" json:"vin,omitempty"`
}
func (x *HMISessionData) Reset() {
*x = HMISessionData{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_depot_data_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HMISessionData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HMISessionData) ProtoMessage() {}
func (x *HMISessionData) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_depot_data_proto_msgTypes[2]
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 HMISessionData.ProtoReflect.Descriptor instead.
func (*HMISessionData) Descriptor() ([]byte, []int) {
return file_kafka_grpc_depot_data_proto_rawDescGZIP(), []int{2}
}
func (x *HMISessionData) GetSessionId() string {
if x != nil {
return x.SessionId
}
return ""
}
func (x *HMISessionData) GetSalt() string {
if x != nil {
return x.Salt
}
return ""
}
func (x *HMISessionData) GetVin() string {
if x != nil {
return x.Vin
}
return ""
}
var File_kafka_grpc_depot_data_proto protoreflect.FileDescriptor
var file_kafka_grpc_depot_data_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x65, 0x70,
0x6f, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01,
0x0a, 0x11, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x44, 0x65, 0x70, 0x6f, 0x74, 0x50, 0x61, 0x79, 0x6c,
0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a,
0x0b, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x48, 0x00, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12,
0x31, 0x0a, 0x0a, 0x68, 0x6d, 0x69, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x48, 0x4d, 0x49, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x68, 0x6d, 0x69, 0x53, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x72, 0x0a, 0x0b, 0x49, 0x6e,
0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74,
0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x54,
0x0a, 0x0e, 0x48, 0x4d, 0x49, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61,
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x53, 0x61,
0x6c, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x76, 0x69, 0x6e, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6b, 0x61, 0x66,
0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_kafka_grpc_depot_data_proto_rawDescOnce sync.Once
file_kafka_grpc_depot_data_proto_rawDescData = file_kafka_grpc_depot_data_proto_rawDesc
)
func file_kafka_grpc_depot_data_proto_rawDescGZIP() []byte {
file_kafka_grpc_depot_data_proto_rawDescOnce.Do(func() {
file_kafka_grpc_depot_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_kafka_grpc_depot_data_proto_rawDescData)
})
return file_kafka_grpc_depot_data_proto_rawDescData
}
var file_kafka_grpc_depot_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_kafka_grpc_depot_data_proto_goTypes = []interface{}{
(*GRPC_DepotPayload)(nil), // 0: GRPC_DepotPayload
(*InitPayload)(nil), // 1: InitPayload
(*HMISessionData)(nil), // 2: HMISessionData
nil, // 3: InitPayload.DataEntry
}
var file_kafka_grpc_depot_data_proto_depIdxs = []int32{
1, // 0: GRPC_DepotPayload.initPayload:type_name -> InitPayload
2, // 1: GRPC_DepotPayload.hmiSession:type_name -> HMISessionData
3, // 2: InitPayload.data:type_name -> InitPayload.DataEntry
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_kafka_grpc_depot_data_proto_init() }
func file_kafka_grpc_depot_data_proto_init() {
if File_kafka_grpc_depot_data_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_kafka_grpc_depot_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_DepotPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_depot_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InitPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_depot_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HMISessionData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_kafka_grpc_depot_data_proto_msgTypes[0].OneofWrappers = []interface{}{
(*GRPC_DepotPayload_InitPayload)(nil),
(*GRPC_DepotPayload_HmiSession)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_kafka_grpc_depot_data_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_kafka_grpc_depot_data_proto_goTypes,
DependencyIndexes: file_kafka_grpc_depot_data_proto_depIdxs,
MessageInfos: file_kafka_grpc_depot_data_proto_msgTypes,
}.Build()
File_kafka_grpc_depot_data_proto = out.File
file_kafka_grpc_depot_data_proto_rawDesc = nil
file_kafka_grpc_depot_data_proto_goTypes = nil
file_kafka_grpc_depot_data_proto_depIdxs = nil
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
message GRPC_DepotPayload {
string handler = 1;
oneof Data {
InitPayload initPayload = 2;
HMISessionData hmiSession = 3;
}
}
message InitPayload {
map<string, string> data = 1;
}
message HMISessionData {
string sessionId = 1;
string Salt = 2;
string vin = 3;
}

View File

@@ -0,0 +1,527 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc v4.25.3
// source: kafka_grpc/trex_log.proto
package kafka_grpc
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)
)
type TRexLog struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"`
Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // This should become an int64 with message sent as unix time
LineNumber int32 `protobuf:"varint,3,opt,name=line_number,json=lineNumber,proto3" json:"line_number,omitempty"`
Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"`
Channel string `protobuf:"bytes,5,opt,name=channel,proto3" json:"channel,omitempty"`
Msg string `protobuf:"bytes,6,opt,name=msg,proto3" json:"msg,omitempty"`
}
func (x *TRexLog) Reset() {
*x = TRexLog{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TRexLog) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TRexLog) ProtoMessage() {}
func (x *TRexLog) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_trex_log_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 TRexLog.ProtoReflect.Descriptor instead.
func (*TRexLog) Descriptor() ([]byte, []int) {
return file_kafka_grpc_trex_log_proto_rawDescGZIP(), []int{0}
}
func (x *TRexLog) GetLevel() int32 {
if x != nil {
return x.Level
}
return 0
}
func (x *TRexLog) GetTimestamp() string {
if x != nil {
return x.Timestamp
}
return ""
}
func (x *TRexLog) GetLineNumber() int32 {
if x != nil {
return x.LineNumber
}
return 0
}
func (x *TRexLog) GetFilename() string {
if x != nil {
return x.Filename
}
return ""
}
func (x *TRexLog) GetChannel() string {
if x != nil {
return x.Channel
}
return ""
}
func (x *TRexLog) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
type TRexLogs struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Logs []*TRexLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
}
func (x *TRexLogs) Reset() {
*x = TRexLogs{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TRexLogs) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TRexLogs) ProtoMessage() {}
func (x *TRexLogs) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[1]
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 TRexLogs.ProtoReflect.Descriptor instead.
func (*TRexLogs) Descriptor() ([]byte, []int) {
return file_kafka_grpc_trex_log_proto_rawDescGZIP(), []int{1}
}
func (x *TRexLogs) GetLogs() []*TRexLog {
if x != nil {
return x.Logs
}
return nil
}
type TRexLogs_BatchPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Handler string `protobuf:"bytes,1,opt,name=Handler,proto3" json:"Handler,omitempty"`
// Types that are assignable to TRexMessage:
//
// *TRexLogs_BatchPayload_Data
// *TRexLogs_BatchPayload_Error
TRexMessage isTRexLogs_BatchPayload_TRexMessage `protobuf_oneof:"TRexMessage"`
Version string `protobuf:"bytes,4,opt,name=Version,proto3" json:"Version,omitempty"`
}
func (x *TRexLogs_BatchPayload) Reset() {
*x = TRexLogs_BatchPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TRexLogs_BatchPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TRexLogs_BatchPayload) ProtoMessage() {}
func (x *TRexLogs_BatchPayload) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[2]
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 TRexLogs_BatchPayload.ProtoReflect.Descriptor instead.
func (*TRexLogs_BatchPayload) Descriptor() ([]byte, []int) {
return file_kafka_grpc_trex_log_proto_rawDescGZIP(), []int{2}
}
func (x *TRexLogs_BatchPayload) GetHandler() string {
if x != nil {
return x.Handler
}
return ""
}
func (m *TRexLogs_BatchPayload) GetTRexMessage() isTRexLogs_BatchPayload_TRexMessage {
if m != nil {
return m.TRexMessage
}
return nil
}
func (x *TRexLogs_BatchPayload) GetData() *TRexLogs {
if x, ok := x.GetTRexMessage().(*TRexLogs_BatchPayload_Data); ok {
return x.Data
}
return nil
}
func (x *TRexLogs_BatchPayload) GetError() *TRexError {
if x, ok := x.GetTRexMessage().(*TRexLogs_BatchPayload_Error); ok {
return x.Error
}
return nil
}
func (x *TRexLogs_BatchPayload) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
type isTRexLogs_BatchPayload_TRexMessage interface {
isTRexLogs_BatchPayload_TRexMessage()
}
type TRexLogs_BatchPayload_Data struct {
Data *TRexLogs `protobuf:"bytes,2,opt,name=Data,proto3,oneof"`
}
type TRexLogs_BatchPayload_Error struct {
Error *TRexError `protobuf:"bytes,3,opt,name=Error,proto3,oneof"`
}
func (*TRexLogs_BatchPayload_Data) isTRexLogs_BatchPayload_TRexMessage() {}
func (*TRexLogs_BatchPayload_Error) isTRexLogs_BatchPayload_TRexMessage() {}
type TRexError struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Message []*TRexErrorMessage `protobuf:"bytes,2,rep,name=message,proto3" json:"message,omitempty"`
}
func (x *TRexError) Reset() {
*x = TRexError{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TRexError) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TRexError) ProtoMessage() {}
func (x *TRexError) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[3]
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 TRexError.ProtoReflect.Descriptor instead.
func (*TRexError) Descriptor() ([]byte, []int) {
return file_kafka_grpc_trex_log_proto_rawDescGZIP(), []int{3}
}
func (x *TRexError) GetCode() int64 {
if x != nil {
return x.Code
}
return 0
}
func (x *TRexError) GetMessage() []*TRexErrorMessage {
if x != nil {
return x.Message
}
return nil
}
type TRexErrorMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"context,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *TRexErrorMessage) Reset() {
*x = TRexErrorMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TRexErrorMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TRexErrorMessage) ProtoMessage() {}
func (x *TRexErrorMessage) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_trex_log_proto_msgTypes[4]
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 TRexErrorMessage.ProtoReflect.Descriptor instead.
func (*TRexErrorMessage) Descriptor() ([]byte, []int) {
return file_kafka_grpc_trex_log_proto_rawDescGZIP(), []int{4}
}
func (x *TRexErrorMessage) GetContext() []string {
if x != nil {
return x.Context
}
return nil
}
func (x *TRexErrorMessage) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
var File_kafka_grpc_trex_log_proto protoreflect.FileDescriptor
var file_kafka_grpc_trex_log_proto_rawDesc = []byte{
0x0a, 0x19, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x72, 0x65,
0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x01, 0x0a, 0x07,
0x54, 0x52, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x6c,
0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08,
0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6d, 0x73, 0x67, 0x22, 0x28, 0x0a, 0x08, 0x54, 0x52, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x73,
0x12, 0x1c, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08,
0x2e, 0x54, 0x52, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x9f,
0x01, 0x0a, 0x15, 0x54, 0x52, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x5f, 0x42, 0x61, 0x74, 0x63,
0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64,
0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c,
0x65, 0x72, 0x12, 0x1f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x09, 0x2e, 0x54, 0x52, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x48, 0x00, 0x52, 0x04, 0x44,
0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x54, 0x52, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00,
0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x54, 0x52, 0x65, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x22, 0x4c, 0x0a, 0x09, 0x54, 0x52, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x54, 0x52, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4e,
0x0a, 0x10, 0x54, 0x52, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x20, 0x0a, 0x0b,
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11,
0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70,
0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_kafka_grpc_trex_log_proto_rawDescOnce sync.Once
file_kafka_grpc_trex_log_proto_rawDescData = file_kafka_grpc_trex_log_proto_rawDesc
)
func file_kafka_grpc_trex_log_proto_rawDescGZIP() []byte {
file_kafka_grpc_trex_log_proto_rawDescOnce.Do(func() {
file_kafka_grpc_trex_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_kafka_grpc_trex_log_proto_rawDescData)
})
return file_kafka_grpc_trex_log_proto_rawDescData
}
var file_kafka_grpc_trex_log_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_kafka_grpc_trex_log_proto_goTypes = []interface{}{
(*TRexLog)(nil), // 0: TRexLog
(*TRexLogs)(nil), // 1: TRexLogs
(*TRexLogs_BatchPayload)(nil), // 2: TRexLogs_BatchPayload
(*TRexError)(nil), // 3: TRexError
(*TRexErrorMessage)(nil), // 4: TRexErrorMessage
}
var file_kafka_grpc_trex_log_proto_depIdxs = []int32{
0, // 0: TRexLogs.logs:type_name -> TRexLog
1, // 1: TRexLogs_BatchPayload.Data:type_name -> TRexLogs
3, // 2: TRexLogs_BatchPayload.Error:type_name -> TRexError
4, // 3: TRexError.message:type_name -> TRexErrorMessage
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_kafka_grpc_trex_log_proto_init() }
func file_kafka_grpc_trex_log_proto_init() {
if File_kafka_grpc_trex_log_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_kafka_grpc_trex_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TRexLog); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_trex_log_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TRexLogs); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_trex_log_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TRexLogs_BatchPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_trex_log_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TRexError); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_trex_log_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TRexErrorMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_kafka_grpc_trex_log_proto_msgTypes[2].OneofWrappers = []interface{}{
(*TRexLogs_BatchPayload_Data)(nil),
(*TRexLogs_BatchPayload_Error)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_kafka_grpc_trex_log_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_kafka_grpc_trex_log_proto_goTypes,
DependencyIndexes: file_kafka_grpc_trex_log_proto_depIdxs,
MessageInfos: file_kafka_grpc_trex_log_proto_msgTypes,
}.Build()
File_kafka_grpc_trex_log_proto = out.File
file_kafka_grpc_trex_log_proto_rawDesc = nil
file_kafka_grpc_trex_log_proto_goTypes = nil
file_kafka_grpc_trex_log_proto_depIdxs = nil
}

View File

@@ -0,0 +1,35 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
message TRexLog {
int32 level = 1;
string timestamp = 2; // This should become an int64 with message sent as unix time
int32 line_number = 3;
string filename = 4;
string channel = 5;
string msg = 6;
}
message TRexLogs {
repeated TRexLog logs = 1;
}
message TRexLogs_BatchPayload {
string Handler = 1;
oneof TRexMessage {
TRexLogs Data = 2;
TRexError Error = 3;
}
string Version = 4;
}
message TRexError {
int64 code = 1;
repeated TRexErrorMessage message = 2;
}
message TRexErrorMessage{
repeated string context = 1;
string description = 2;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,229 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
message GRPC_ValetPayload {
string handler = 1;
oneof Data {
VIN emptyMsg = 2;
RemoteCommand remoteCmd = 3;
VIN digitalTwinReq = 4;
MapDestinationRequest mapDestReq = 5;
MapRouteRequest MapRouteReq = 6;
MapHistory mapHistory = 7;
MobileSettingsUpdate settingsUpdate = 8;
MobileChargeSetting mobileChargeSetting = 9;
DepartureSchedule departureSchedule = 10;
StorePurchases storePurchases = 11;
PointOfInterest poiCreate = 12;
MobilePOIEditMessage poiEdit = 13;
MobilePOIDeleteMessage poiDelete = 14;
VIN wakecar = 15;
AddIssueRequest addIssueReq = 16;
ChargingCommand chCMD = 17;
RemoteCommandSrc remoteCmdSrc = 18;
MobileDepartureSchedule mobileDepartureSchedule = 19;
BLEKeyRequest BLEKey = 20;
HMISettingsUpdate hmiSettingsUpdate = 21;
HMIMapHistory hmiMapHistory = 22;
HMIPOIsMessage hmiPOIsMessage = 23;
UserConsentFromHMI userConsentFromHMI = 24;
JSONHMIDeleteProfile hmiDeleteProfile = 25;
ChargeSettings chargeSetting = 26;
}
}
message VIN {
string vin = 1;
}
message RemoteCommand {
string vin = 1;
string source = 2;
optional string time = 3;
int64 wait_dur = 4;
string command = 5;
optional string data = 6;
optional string start = 7;
optional string end = 8;
}
message RemoteCommandSrc {
string cmd = 1;
optional string data = 2;
optional int64 start = 3;
optional int64 end = 4;
}
message MapDestinationRequest {
string vin = 1;
string name = 2;
TomTomAddress address = 3;
MapCoordinates coordinates = 4;
}
message MapCoordinates {
double latitude = 1 [json_name = "latitude"];
double longitude = 2 [json_name = "longitude"];
}
message TomTomAddress {
string street_number = 1;
string street_name = 2;
string local_name = 3;
string postal_code = 4;
string country_subdivision_name = 5;
string country_code_iso3 = 6;
}
message MapRouteRequest {
string vin = 1;
repeated MapWaypoint waypoints = 2;
repeated MapCoordinates route = 3;
}
message MapWaypoint {
string type = 1;
string title = 2;
MapCoordinates coordinates = 3;
}
message MapHistory {
string name = 1 [json_name = "name"];
string description = 2 [json_name = "description"];
MapCoordinates location = 3 [json_name = "location"];
}
message CarSetting {
string vin = 1;
string driverId = 2;
string name = 3;
string value = 4;
string type = 5;
optional int64 created = 6;
optional int64 updated = 7;
}
message MobileSettingsUpdate {
string vin = 1;
repeated CarSetting settings = 2;
}
message HMISettingsUpdate {
string driverId = 1;
repeated CarSetting settings = 2;
}
message MobileDepartureSchedule {
string vin = 1;
DepartureSchedule departure_schedule = 2;
}
message DepartureSchedule {
optional string next_day_departure = 1;
repeated DepartureDay departure_days = 2;
}
message DepartureDay {
string day_of_week = 1;
string time = 2;
}
message MobileChargeSetting {
string vin = 1;
ChargeSettings chargeSettings = 2;
}
message ChargeSettings {
int32 charge_limit = 1;
int32 max_current = 2;
optional int32 minCharge = 3 [json_name = "min_charge"];
OffPeakCharging offPeakCcharging = 4 [json_name = "off_peak_charging"];
}
message OffPeakCharging {
int64 start = 1;
int64 end = 2;
}
message StorePurchaseItem {
string id = 1;
}
message StorePurchases {
string vin = 1;
repeated StorePurchaseItem purchases = 2;
}
message PointOfInterest {
string name = 1;
POILocation location = 2;
}
message POILocation {
double latitude = 1 [json_name = "latitude"];
double longitude = 2 [json_name = "longitude"];
}
message MobilePOIEditMessage {
string old_name = 1;
PointOfInterest user_poi = 2;
}
message MobilePOIDeleteMessage {
string name = 1;
}
message AddIssueRequest {
Issue issue = 1;
repeated bytes images = 2;
}
message Issue {
int32 id = 1;
string vin = 2;
string title = 3;
string description = 4;
string driver_id = 5;
int64 timestamp = 6;
repeated IssueImage images = 7;
}
message IssueImage {
int32 id = 1;
bytes image = 2;
int32 issue_id = 3;
}
message ChargingCommand {
string action = 1;
}
message BLEKeyRequest {
string driver_id = 1;
string ble_key = 2;
}
message HMIMapHistory {
string driver_id = 1;
repeated MapHistory searches = 2;
}
message HMIPOIsMessage {
string DriverId = 1 [json_name = "driver_id"];
repeated PointOfInterest userPOIs = 2 [json_name = "user_pois"];
}
message UserConsentFromHMI {
repeated UserConsent userConsent = 1;
}
message UserConsent {
string name = 1;
bool accept = 2;
string driver_id = 3;
}
message JSONHMIDeleteProfile {
string driver_id = 1;
}

View File

@@ -0,0 +1,348 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc v4.25.3
// source: kafka_grpc/vehicle_data.proto
package kafka_grpc
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)
)
type GRPC_CANFrame struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Epoch int64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
ID int32 `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,omitempty"`
}
func (x *GRPC_CANFrame) Reset() {
*x = GRPC_CANFrame{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_data_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_CANFrame) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_CANFrame) ProtoMessage() {}
func (x *GRPC_CANFrame) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_data_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 GRPC_CANFrame.ProtoReflect.Descriptor instead.
func (*GRPC_CANFrame) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_data_proto_rawDescGZIP(), []int{0}
}
func (x *GRPC_CANFrame) GetEpoch() int64 {
if x != nil {
return x.Epoch
}
return 0
}
func (x *GRPC_CANFrame) GetValue() []byte {
if x != nil {
return x.Value
}
return nil
}
func (x *GRPC_CANFrame) GetID() int32 {
if x != nil {
return x.ID
}
return 0
}
type GRPC_CANData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
EpochUsec int64 `protobuf:"varint,1,opt,name=epoch_usec,json=epochUsec,proto3" json:"epoch_usec,omitempty"`
Dropped int32 `protobuf:"varint,2,opt,name=dropped,proto3" json:"dropped,omitempty"`
Filtered int32 `protobuf:"varint,3,opt,name=filtered,proto3" json:"filtered,omitempty"`
Frames []*GRPC_CANFrame `protobuf:"bytes,4,rep,name=frames,proto3" json:"frames,omitempty"`
Vin string `protobuf:"bytes,5,opt,name=vin,proto3" json:"vin,omitempty"`
}
func (x *GRPC_CANData) Reset() {
*x = GRPC_CANData{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_data_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_CANData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_CANData) ProtoMessage() {}
func (x *GRPC_CANData) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_data_proto_msgTypes[1]
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 GRPC_CANData.ProtoReflect.Descriptor instead.
func (*GRPC_CANData) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_data_proto_rawDescGZIP(), []int{1}
}
func (x *GRPC_CANData) GetEpochUsec() int64 {
if x != nil {
return x.EpochUsec
}
return 0
}
func (x *GRPC_CANData) GetDropped() int32 {
if x != nil {
return x.Dropped
}
return 0
}
func (x *GRPC_CANData) GetFiltered() int32 {
if x != nil {
return x.Filtered
}
return 0
}
func (x *GRPC_CANData) GetFrames() []*GRPC_CANFrame {
if x != nil {
return x.Frames
}
return nil
}
func (x *GRPC_CANData) GetVin() string {
if x != nil {
return x.Vin
}
return ""
}
type GRPC_BatchPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Handler string `protobuf:"bytes,1,opt,name=Handler,proto3" json:"Handler,omitempty"`
Data *GRPC_CANData `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
Version string `protobuf:"bytes,3,opt,name=Version,proto3" json:"Version,omitempty"`
}
func (x *GRPC_BatchPayload) Reset() {
*x = GRPC_BatchPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_data_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_BatchPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_BatchPayload) ProtoMessage() {}
func (x *GRPC_BatchPayload) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_data_proto_msgTypes[2]
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 GRPC_BatchPayload.ProtoReflect.Descriptor instead.
func (*GRPC_BatchPayload) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_data_proto_rawDescGZIP(), []int{2}
}
func (x *GRPC_BatchPayload) GetHandler() string {
if x != nil {
return x.Handler
}
return ""
}
func (x *GRPC_BatchPayload) GetData() *GRPC_CANData {
if x != nil {
return x.Data
}
return nil
}
func (x *GRPC_BatchPayload) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
var File_kafka_grpc_vehicle_data_proto protoreflect.FileDescriptor
var file_kafka_grpc_vehicle_data_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x65, 0x68,
0x69, 0x63, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x4b, 0x0a, 0x0d, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x46, 0x72, 0x61, 0x6d, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x22, 0x9d, 0x01, 0x0a,
0x0c, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a,
0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x75, 0x73, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x55, 0x73, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07,
0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64,
0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x65, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x46, 0x72, 0x61,
0x6d, 0x65, 0x52, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69,
0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x69, 0x6e, 0x22, 0x6a, 0x0a, 0x11,
0x47, 0x52, 0x50, 0x43, 0x5f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x04, 0x44,
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x47, 0x52, 0x50, 0x43,
0x5f, 0x43, 0x41, 0x4e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18,
0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63,
0x2f, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_kafka_grpc_vehicle_data_proto_rawDescOnce sync.Once
file_kafka_grpc_vehicle_data_proto_rawDescData = file_kafka_grpc_vehicle_data_proto_rawDesc
)
func file_kafka_grpc_vehicle_data_proto_rawDescGZIP() []byte {
file_kafka_grpc_vehicle_data_proto_rawDescOnce.Do(func() {
file_kafka_grpc_vehicle_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_kafka_grpc_vehicle_data_proto_rawDescData)
})
return file_kafka_grpc_vehicle_data_proto_rawDescData
}
var file_kafka_grpc_vehicle_data_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_kafka_grpc_vehicle_data_proto_goTypes = []interface{}{
(*GRPC_CANFrame)(nil), // 0: GRPC_CANFrame
(*GRPC_CANData)(nil), // 1: GRPC_CANData
(*GRPC_BatchPayload)(nil), // 2: GRPC_BatchPayload
}
var file_kafka_grpc_vehicle_data_proto_depIdxs = []int32{
0, // 0: GRPC_CANData.frames:type_name -> GRPC_CANFrame
1, // 1: GRPC_BatchPayload.Data:type_name -> GRPC_CANData
2, // [2:2] is the sub-list for method output_type
2, // [2:2] 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_kafka_grpc_vehicle_data_proto_init() }
func file_kafka_grpc_vehicle_data_proto_init() {
if File_kafka_grpc_vehicle_data_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_kafka_grpc_vehicle_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_CANFrame); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_vehicle_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_CANData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_vehicle_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_BatchPayload); 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_kafka_grpc_vehicle_data_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_kafka_grpc_vehicle_data_proto_goTypes,
DependencyIndexes: file_kafka_grpc_vehicle_data_proto_depIdxs,
MessageInfos: file_kafka_grpc_vehicle_data_proto_msgTypes,
}.Build()
File_kafka_grpc_vehicle_data_proto = out.File
file_kafka_grpc_vehicle_data_proto_rawDesc = nil
file_kafka_grpc_vehicle_data_proto_goTypes = nil
file_kafka_grpc_vehicle_data_proto_depIdxs = nil
}

View File

@@ -0,0 +1,23 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
message GRPC_CANFrame {
int64 epoch = 1;
bytes Value = 2;
int32 ID = 3;
}
message GRPC_CANData {
int64 epoch_usec = 1;
int32 dropped = 2;
int32 filtered = 3;
repeated GRPC_CANFrame frames = 4;
string vin = 5;
}
message GRPC_BatchPayload {
string Handler = 1;
GRPC_CANData Data = 2;
string Version = 3;
}

View File

@@ -0,0 +1,340 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc v4.25.3
// source: kafka_grpc/vehicle_signal.proto
package kafka_grpc
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)
)
type GRPC_CANSignal struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Vin string `protobuf:"bytes,1,opt,name=vin,proto3" json:"vin,omitempty"`
Timestamp float64 `protobuf:"fixed64,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Id int32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Value float64 `protobuf:"fixed64,5,opt,name=value,proto3" json:"value,omitempty"`
Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *GRPC_CANSignal) Reset() {
*x = GRPC_CANSignal{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_signal_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_CANSignal) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_CANSignal) ProtoMessage() {}
func (x *GRPC_CANSignal) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_signal_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 GRPC_CANSignal.ProtoReflect.Descriptor instead.
func (*GRPC_CANSignal) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_signal_proto_rawDescGZIP(), []int{0}
}
func (x *GRPC_CANSignal) GetVin() string {
if x != nil {
return x.Vin
}
return ""
}
func (x *GRPC_CANSignal) GetTimestamp() float64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *GRPC_CANSignal) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *GRPC_CANSignal) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *GRPC_CANSignal) GetValue() float64 {
if x != nil {
return x.Value
}
return 0
}
func (x *GRPC_CANSignal) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
type GRPC_CANSignalData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Cansignals []*GRPC_CANSignal `protobuf:"bytes,1,rep,name=cansignals,proto3" json:"cansignals,omitempty"`
}
func (x *GRPC_CANSignalData) Reset() {
*x = GRPC_CANSignalData{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_signal_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_CANSignalData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_CANSignalData) ProtoMessage() {}
func (x *GRPC_CANSignalData) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_signal_proto_msgTypes[1]
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 GRPC_CANSignalData.ProtoReflect.Descriptor instead.
func (*GRPC_CANSignalData) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_signal_proto_rawDescGZIP(), []int{1}
}
func (x *GRPC_CANSignalData) GetCansignals() []*GRPC_CANSignal {
if x != nil {
return x.Cansignals
}
return nil
}
type GRPC_CANSignalBatchPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Handler string `protobuf:"bytes,1,opt,name=Handler,proto3" json:"Handler,omitempty"`
Data *GRPC_CANSignalData `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
Version string `protobuf:"bytes,3,opt,name=Version,proto3" json:"Version,omitempty"`
}
func (x *GRPC_CANSignalBatchPayload) Reset() {
*x = GRPC_CANSignalBatchPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_kafka_grpc_vehicle_signal_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GRPC_CANSignalBatchPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GRPC_CANSignalBatchPayload) ProtoMessage() {}
func (x *GRPC_CANSignalBatchPayload) ProtoReflect() protoreflect.Message {
mi := &file_kafka_grpc_vehicle_signal_proto_msgTypes[2]
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 GRPC_CANSignalBatchPayload.ProtoReflect.Descriptor instead.
func (*GRPC_CANSignalBatchPayload) Descriptor() ([]byte, []int) {
return file_kafka_grpc_vehicle_signal_proto_rawDescGZIP(), []int{2}
}
func (x *GRPC_CANSignalBatchPayload) GetHandler() string {
if x != nil {
return x.Handler
}
return ""
}
func (x *GRPC_CANSignalBatchPayload) GetData() *GRPC_CANSignalData {
if x != nil {
return x.Data
}
return nil
}
func (x *GRPC_CANSignalBatchPayload) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
var File_kafka_grpc_vehicle_signal_proto protoreflect.FileDescriptor
var file_kafka_grpc_vehicle_signal_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x65, 0x68,
0x69, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x0e, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x53, 0x69,
0x67, 0x6e, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x76, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20,
0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x45, 0x0a, 0x12, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x53, 0x69, 0x67, 0x6e,
0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0a, 0x63, 0x61, 0x6e, 0x73, 0x69, 0x67,
0x6e, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x47, 0x52, 0x50,
0x43, 0x5f, 0x43, 0x41, 0x4e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x0a, 0x63, 0x61, 0x6e,
0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x22, 0x79, 0x0a, 0x1a, 0x47, 0x52, 0x50, 0x43, 0x5f,
0x43, 0x41, 0x4e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12,
0x27, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x47, 0x52, 0x50, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x44, 0x61,
0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6b, 0x61, 0x66, 0x6b, 0x61,
0x5f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_kafka_grpc_vehicle_signal_proto_rawDescOnce sync.Once
file_kafka_grpc_vehicle_signal_proto_rawDescData = file_kafka_grpc_vehicle_signal_proto_rawDesc
)
func file_kafka_grpc_vehicle_signal_proto_rawDescGZIP() []byte {
file_kafka_grpc_vehicle_signal_proto_rawDescOnce.Do(func() {
file_kafka_grpc_vehicle_signal_proto_rawDescData = protoimpl.X.CompressGZIP(file_kafka_grpc_vehicle_signal_proto_rawDescData)
})
return file_kafka_grpc_vehicle_signal_proto_rawDescData
}
var file_kafka_grpc_vehicle_signal_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_kafka_grpc_vehicle_signal_proto_goTypes = []interface{}{
(*GRPC_CANSignal)(nil), // 0: GRPC_CANSignal
(*GRPC_CANSignalData)(nil), // 1: GRPC_CANSignalData
(*GRPC_CANSignalBatchPayload)(nil), // 2: GRPC_CANSignalBatchPayload
}
var file_kafka_grpc_vehicle_signal_proto_depIdxs = []int32{
0, // 0: GRPC_CANSignalData.cansignals:type_name -> GRPC_CANSignal
1, // 1: GRPC_CANSignalBatchPayload.Data:type_name -> GRPC_CANSignalData
2, // [2:2] is the sub-list for method output_type
2, // [2:2] 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_kafka_grpc_vehicle_signal_proto_init() }
func file_kafka_grpc_vehicle_signal_proto_init() {
if File_kafka_grpc_vehicle_signal_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_kafka_grpc_vehicle_signal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_CANSignal); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_vehicle_signal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_CANSignalData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_kafka_grpc_vehicle_signal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GRPC_CANSignalBatchPayload); 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_kafka_grpc_vehicle_signal_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_kafka_grpc_vehicle_signal_proto_goTypes,
DependencyIndexes: file_kafka_grpc_vehicle_signal_proto_depIdxs,
MessageInfos: file_kafka_grpc_vehicle_signal_proto_msgTypes,
}.Build()
File_kafka_grpc_vehicle_signal_proto = out.File
file_kafka_grpc_vehicle_signal_proto_rawDesc = nil
file_kafka_grpc_vehicle_signal_proto_goTypes = nil
file_kafka_grpc_vehicle_signal_proto_depIdxs = nil
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "grpc/kafka_grpc";
message GRPC_CANSignal {
string vin = 1;
double timestamp = 2;
int32 id = 3;
string name = 4;
double value = 5;
string description = 6;
}
message GRPC_CANSignalData {
repeated GRPC_CANSignal cansignals = 1;
}
message GRPC_CANSignalBatchPayload {
string Handler = 1;
GRPC_CANSignalData Data = 2;
string Version = 3;
}

1492
pkg/grpc/sms/sms.pb.go Normal file

File diff suppressed because it is too large Load Diff

120
pkg/grpc/sms/sms.proto Normal file
View File

@@ -0,0 +1,120 @@
syntax = "proto3";
option go_package = "grpc/sms";
service SMSService {
rpc HandleSMSSend(SendSMSRequest) returns (SMSDetailsResponse) {}
rpc HandleSMSQueue(SendSMSRequest) returns (SMSQueueResponse) {}
rpc HandleGetProducts(GetAvailableProductsRequest) returns (GetAvailableProductsResponse) {}
rpc HandleChangeRatePlan(ChangeRatePlanRequest) returns (ChangeRatePlanResponse) {}
rpc HandleCustomAttributes(CustomAtributesRequest) returns (CustomAtributeResponse) {}
rpc HandleDeviceDetails(DeviceDetailsRequest) returns (DeviceDetailsResponse) {}
}
message SendSMSRequest {
string ICCID = 1;
string messageText = 3;
enum MsgEncoding {
LITERAL = 0;
BASE64 = 1;
}
optional MsgEncoding messageEncoding = 4;
enum DataCoding {
ZERO = 0;
ONE = 1;
THREE = 3;
FOUR = 4;
EIGHT = 8;
}
optional DataCoding dataCoding = 5;
optional string tpvp = 6;
bool await = 7;
string KafkaServiceTarget = 8;
}
message SMSDetailsResponse {
string smsMsgID = 1;
enum Status {
Unknown = 0;
Received = 1;
Cancelled = 2;
CancelFailed = 3;
CancelPending = 4;
Delivered = 5;
Pending = 6;
Failed = 7;
}
Status status = 2;
string messageText = 3;
string senderLogin = 4;
string sentTo = 5;
string sentFrom = 6;
string msgType = 7;
string dateSent = 8;
string dateModified = 9;
string ICCID = 10;
}
message SMSQueueResponse {
string smsMsgID = 1;
bool sentSuccessful = 2;
}
message ChangeRatePlanRequest {
string productId = 1;
string ICCID = 2;
string accountId = 3;
}
message ChangeRatePlanResponse {
string ICCID = 1;
}
message CustomAtributesRequest {
string ICCID = 1;
string accountCustom1 = 2;
}
message CustomAtributeResponse {
string ICCID = 1;
}
message GetAvailableProductsRequest {
string accountId = 1;
repeated string productType = 2;
repeated string productClassification = 3;
}
message RatePlan {
string ratePlanName = 1;
string planType = 2;
string planStatus = 3;
string chargeUnit = 4;
}
message AvailableTmobileProduct {
string id = 1;
string productId = 2;
string shortDescription = 3;
string longDescription = 4;
string status = 5;
string effectiveDate = 6;
string expirationDate = 7;
RatePlan ratePlan = 8;
}
message GetAvailableProductsResponse {
repeated AvailableTmobileProduct availableProducts = 1;
}
message DeviceDetailsRequest {
string ICCID = 1;
}
message DeviceDetailsResponse {
string ICCID = 1;
string ratePlan = 2;
string accountId = 3;
string accountCustom1 = 4;
string status = 5;
}

294
pkg/grpc/sms/sms_grpc.pb.go Normal file
View File

@@ -0,0 +1,294 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.3
// source: sms/sms.proto
package sms
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
SMSService_HandleSMSSend_FullMethodName = "/SMSService/HandleSMSSend"
SMSService_HandleSMSQueue_FullMethodName = "/SMSService/HandleSMSQueue"
SMSService_HandleGetProducts_FullMethodName = "/SMSService/HandleGetProducts"
SMSService_HandleChangeRatePlan_FullMethodName = "/SMSService/HandleChangeRatePlan"
SMSService_HandleCustomAttributes_FullMethodName = "/SMSService/HandleCustomAttributes"
SMSService_HandleDeviceDetails_FullMethodName = "/SMSService/HandleDeviceDetails"
)
// SMSServiceClient is the client API for SMSService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SMSServiceClient interface {
HandleSMSSend(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSDetailsResponse, error)
HandleSMSQueue(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSQueueResponse, error)
HandleGetProducts(ctx context.Context, in *GetAvailableProductsRequest, opts ...grpc.CallOption) (*GetAvailableProductsResponse, error)
HandleChangeRatePlan(ctx context.Context, in *ChangeRatePlanRequest, opts ...grpc.CallOption) (*ChangeRatePlanResponse, error)
HandleCustomAttributes(ctx context.Context, in *CustomAtributesRequest, opts ...grpc.CallOption) (*CustomAtributeResponse, error)
HandleDeviceDetails(ctx context.Context, in *DeviceDetailsRequest, opts ...grpc.CallOption) (*DeviceDetailsResponse, error)
}
type sMSServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSMSServiceClient(cc grpc.ClientConnInterface) SMSServiceClient {
return &sMSServiceClient{cc}
}
func (c *sMSServiceClient) HandleSMSSend(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSDetailsResponse, error) {
out := new(SMSDetailsResponse)
err := c.cc.Invoke(ctx, SMSService_HandleSMSSend_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMSServiceClient) HandleSMSQueue(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSQueueResponse, error) {
out := new(SMSQueueResponse)
err := c.cc.Invoke(ctx, SMSService_HandleSMSQueue_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMSServiceClient) HandleGetProducts(ctx context.Context, in *GetAvailableProductsRequest, opts ...grpc.CallOption) (*GetAvailableProductsResponse, error) {
out := new(GetAvailableProductsResponse)
err := c.cc.Invoke(ctx, SMSService_HandleGetProducts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMSServiceClient) HandleChangeRatePlan(ctx context.Context, in *ChangeRatePlanRequest, opts ...grpc.CallOption) (*ChangeRatePlanResponse, error) {
out := new(ChangeRatePlanResponse)
err := c.cc.Invoke(ctx, SMSService_HandleChangeRatePlan_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMSServiceClient) HandleCustomAttributes(ctx context.Context, in *CustomAtributesRequest, opts ...grpc.CallOption) (*CustomAtributeResponse, error) {
out := new(CustomAtributeResponse)
err := c.cc.Invoke(ctx, SMSService_HandleCustomAttributes_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMSServiceClient) HandleDeviceDetails(ctx context.Context, in *DeviceDetailsRequest, opts ...grpc.CallOption) (*DeviceDetailsResponse, error) {
out := new(DeviceDetailsResponse)
err := c.cc.Invoke(ctx, SMSService_HandleDeviceDetails_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SMSServiceServer is the server API for SMSService service.
// All implementations must embed UnimplementedSMSServiceServer
// for forward compatibility
type SMSServiceServer interface {
HandleSMSSend(context.Context, *SendSMSRequest) (*SMSDetailsResponse, error)
HandleSMSQueue(context.Context, *SendSMSRequest) (*SMSQueueResponse, error)
HandleGetProducts(context.Context, *GetAvailableProductsRequest) (*GetAvailableProductsResponse, error)
HandleChangeRatePlan(context.Context, *ChangeRatePlanRequest) (*ChangeRatePlanResponse, error)
HandleCustomAttributes(context.Context, *CustomAtributesRequest) (*CustomAtributeResponse, error)
HandleDeviceDetails(context.Context, *DeviceDetailsRequest) (*DeviceDetailsResponse, error)
mustEmbedUnimplementedSMSServiceServer()
}
// UnimplementedSMSServiceServer must be embedded to have forward compatible implementations.
type UnimplementedSMSServiceServer struct {
}
func (UnimplementedSMSServiceServer) HandleSMSSend(context.Context, *SendSMSRequest) (*SMSDetailsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleSMSSend not implemented")
}
func (UnimplementedSMSServiceServer) HandleSMSQueue(context.Context, *SendSMSRequest) (*SMSQueueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleSMSQueue not implemented")
}
func (UnimplementedSMSServiceServer) HandleGetProducts(context.Context, *GetAvailableProductsRequest) (*GetAvailableProductsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleGetProducts not implemented")
}
func (UnimplementedSMSServiceServer) HandleChangeRatePlan(context.Context, *ChangeRatePlanRequest) (*ChangeRatePlanResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleChangeRatePlan not implemented")
}
func (UnimplementedSMSServiceServer) HandleCustomAttributes(context.Context, *CustomAtributesRequest) (*CustomAtributeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleCustomAttributes not implemented")
}
func (UnimplementedSMSServiceServer) HandleDeviceDetails(context.Context, *DeviceDetailsRequest) (*DeviceDetailsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleDeviceDetails not implemented")
}
func (UnimplementedSMSServiceServer) mustEmbedUnimplementedSMSServiceServer() {}
// UnsafeSMSServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SMSServiceServer will
// result in compilation errors.
type UnsafeSMSServiceServer interface {
mustEmbedUnimplementedSMSServiceServer()
}
func RegisterSMSServiceServer(s grpc.ServiceRegistrar, srv SMSServiceServer) {
s.RegisterService(&SMSService_ServiceDesc, srv)
}
func _SMSService_HandleSMSSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendSMSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleSMSSend(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleSMSSend_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleSMSSend(ctx, req.(*SendSMSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SMSService_HandleSMSQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendSMSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleSMSQueue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleSMSQueue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleSMSQueue(ctx, req.(*SendSMSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SMSService_HandleGetProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAvailableProductsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleGetProducts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleGetProducts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleGetProducts(ctx, req.(*GetAvailableProductsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SMSService_HandleChangeRatePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangeRatePlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleChangeRatePlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleChangeRatePlan_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleChangeRatePlan(ctx, req.(*ChangeRatePlanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SMSService_HandleCustomAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CustomAtributesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleCustomAttributes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleCustomAttributes_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleCustomAttributes(ctx, req.(*CustomAtributesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SMSService_HandleDeviceDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeviceDetailsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SMSServiceServer).HandleDeviceDetails(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SMSService_HandleDeviceDetails_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SMSServiceServer).HandleDeviceDetails(ctx, req.(*DeviceDetailsRequest))
}
return interceptor(ctx, in, info, handler)
}
// SMSService_ServiceDesc is the grpc.ServiceDesc for SMSService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SMSService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "SMSService",
HandlerType: (*SMSServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "HandleSMSSend",
Handler: _SMSService_HandleSMSSend_Handler,
},
{
MethodName: "HandleSMSQueue",
Handler: _SMSService_HandleSMSQueue_Handler,
},
{
MethodName: "HandleGetProducts",
Handler: _SMSService_HandleGetProducts_Handler,
},
{
MethodName: "HandleChangeRatePlan",
Handler: _SMSService_HandleChangeRatePlan_Handler,
},
{
MethodName: "HandleCustomAttributes",
Handler: _SMSService_HandleCustomAttributes_Handler,
},
{
MethodName: "HandleDeviceDetails",
Handler: _SMSService_HandleDeviceDetails_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "sms/sms.proto",
}

57
pkg/grpc/sms/smsmock.go Normal file
View File

@@ -0,0 +1,57 @@
package sms
import (
"context"
"google.golang.org/grpc"
)
type SMSSendHandlerFunc func(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSDetailsResponse, error)
func NewSMSMock(handler SMSSendHandlerFunc) SMSMock {
return SMSMock{
SMSSendHandler: handler,
}
}
func NewSMSMockSuccess() SMSMock {
return SMSMock{
SMSSendHandler: func(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSDetailsResponse, error) {
return nil, nil
},
}
}
type SMSMock struct {
SMSSendHandler SMSSendHandlerFunc
UnimplementedSMSServiceServer
queueResponse *SMSQueueResponse
queueResponseError error
}
func (m *SMSMock) HandleSMSSend(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSDetailsResponse, error) {
return m.SMSSendHandler(ctx, in, opts...)
}
// HandleSMSQueue implements sms.SMSServiceClient.
func (m *SMSMock) HandleSMSQueue(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*SMSQueueResponse, error) {
return m.queueResponse, m.queueResponseError
}
func (m *SMSMock) SetHandleSMSQueueResponse(response *SMSQueueResponse, err error) {
m.queueResponse = response
m.queueResponseError = err
}
func (m *SMSMock) HandleGetProducts(ctx context.Context, in *GetAvailableProductsRequest, opts ...grpc.CallOption) (*GetAvailableProductsResponse, error) {
return nil, nil
}
func (m *SMSMock) HandleChangeRatePlan(ctx context.Context, in *ChangeRatePlanRequest, opts ...grpc.CallOption) (*ChangeRatePlanResponse, error) {
return nil, nil
}
func (m *SMSMock) HandleCustomAttributes(ctx context.Context, in *CustomAtributesRequest, opts ...grpc.CallOption) (*CustomAtributeResponse, error) {
return nil, nil
}
func (m *SMSMock) HandleDeviceDetails(ctx context.Context, in *DeviceDetailsRequest, opts ...grpc.CallOption) (*DeviceDetailsResponse, error) {
return nil, nil
}