add: anowflake email kafka, refa: redis connectg
This commit is contained in:
@@ -0,0 +1,263 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v3.19.4
|
||||
// source: snowflake.proto
|
||||
|
||||
package snowflake
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type NextIdReq struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NextIdReq) Reset() {
|
||||
*x = NextIdReq{}
|
||||
mi := &file_snowflake_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NextIdReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NextIdReq) ProtoMessage() {}
|
||||
|
||||
func (x *NextIdReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_snowflake_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NextIdReq.ProtoReflect.Descriptor instead.
|
||||
func (*NextIdReq) Descriptor() ([]byte, []int) {
|
||||
return file_snowflake_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type NextIdResp struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NextIdResp) Reset() {
|
||||
*x = NextIdResp{}
|
||||
mi := &file_snowflake_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NextIdResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NextIdResp) ProtoMessage() {}
|
||||
|
||||
func (x *NextIdResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_snowflake_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NextIdResp.ProtoReflect.Descriptor instead.
|
||||
func (*NextIdResp) Descriptor() ([]byte, []int) {
|
||||
return file_snowflake_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *NextIdResp) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type NextIdsReq struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NextIdsReq) Reset() {
|
||||
*x = NextIdsReq{}
|
||||
mi := &file_snowflake_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NextIdsReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NextIdsReq) ProtoMessage() {}
|
||||
|
||||
func (x *NextIdsReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_snowflake_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NextIdsReq.ProtoReflect.Descriptor instead.
|
||||
func (*NextIdsReq) Descriptor() ([]byte, []int) {
|
||||
return file_snowflake_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *NextIdsReq) GetCount() int32 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type NextIdsResp struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NextIdsResp) Reset() {
|
||||
*x = NextIdsResp{}
|
||||
mi := &file_snowflake_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NextIdsResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NextIdsResp) ProtoMessage() {}
|
||||
|
||||
func (x *NextIdsResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_snowflake_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NextIdsResp.ProtoReflect.Descriptor instead.
|
||||
func (*NextIdsResp) Descriptor() ([]byte, []int) {
|
||||
return file_snowflake_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *NextIdsResp) GetIds() []int64 {
|
||||
if x != nil {
|
||||
return x.Ids
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_snowflake_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_snowflake_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x0fsnowflake.proto\x12\tsnowflake\"\v\n" +
|
||||
"\tNextIdReq\"\x1c\n" +
|
||||
"\n" +
|
||||
"NextIdResp\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"\"\n" +
|
||||
"\n" +
|
||||
"NextIdsReq\x12\x14\n" +
|
||||
"\x05count\x18\x01 \x01(\x05R\x05count\"\x1f\n" +
|
||||
"\vNextIdsResp\x12\x10\n" +
|
||||
"\x03ids\x18\x01 \x03(\x03R\x03ids2\x83\x01\n" +
|
||||
"\x10SnowflakeService\x125\n" +
|
||||
"\x06NextId\x12\x14.snowflake.NextIdReq\x1a\x15.snowflake.NextIdResp\x128\n" +
|
||||
"\aNextIds\x12\x15.snowflake.NextIdsReq\x1a\x16.snowflake.NextIdsRespB\rZ\v./snowflakeb\x06proto3"
|
||||
|
||||
var (
|
||||
file_snowflake_proto_rawDescOnce sync.Once
|
||||
file_snowflake_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_snowflake_proto_rawDescGZIP() []byte {
|
||||
file_snowflake_proto_rawDescOnce.Do(func() {
|
||||
file_snowflake_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_snowflake_proto_rawDesc), len(file_snowflake_proto_rawDesc)))
|
||||
})
|
||||
return file_snowflake_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_snowflake_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_snowflake_proto_goTypes = []any{
|
||||
(*NextIdReq)(nil), // 0: snowflake.NextIdReq
|
||||
(*NextIdResp)(nil), // 1: snowflake.NextIdResp
|
||||
(*NextIdsReq)(nil), // 2: snowflake.NextIdsReq
|
||||
(*NextIdsResp)(nil), // 3: snowflake.NextIdsResp
|
||||
}
|
||||
var file_snowflake_proto_depIdxs = []int32{
|
||||
0, // 0: snowflake.SnowflakeService.NextId:input_type -> snowflake.NextIdReq
|
||||
2, // 1: snowflake.SnowflakeService.NextIds:input_type -> snowflake.NextIdsReq
|
||||
1, // 2: snowflake.SnowflakeService.NextId:output_type -> snowflake.NextIdResp
|
||||
3, // 3: snowflake.SnowflakeService.NextIds:output_type -> snowflake.NextIdsResp
|
||||
2, // [2:4] is the sub-list for method output_type
|
||||
0, // [0:2] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_snowflake_proto_init() }
|
||||
func file_snowflake_proto_init() {
|
||||
if File_snowflake_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_snowflake_proto_rawDesc), len(file_snowflake_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_snowflake_proto_goTypes,
|
||||
DependencyIndexes: file_snowflake_proto_depIdxs,
|
||||
MessageInfos: file_snowflake_proto_msgTypes,
|
||||
}.Build()
|
||||
File_snowflake_proto = out.File
|
||||
file_snowflake_proto_goTypes = nil
|
||||
file_snowflake_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v3.19.4
|
||||
// source: snowflake.proto
|
||||
|
||||
package snowflake
|
||||
|
||||
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.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SnowflakeService_NextId_FullMethodName = "/snowflake.SnowflakeService/NextId"
|
||||
SnowflakeService_NextIds_FullMethodName = "/snowflake.SnowflakeService/NextIds"
|
||||
)
|
||||
|
||||
// SnowflakeServiceClient is the client API for SnowflakeService 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 SnowflakeServiceClient interface {
|
||||
NextId(ctx context.Context, in *NextIdReq, opts ...grpc.CallOption) (*NextIdResp, error)
|
||||
NextIds(ctx context.Context, in *NextIdsReq, opts ...grpc.CallOption) (*NextIdsResp, error)
|
||||
}
|
||||
|
||||
type snowflakeServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSnowflakeServiceClient(cc grpc.ClientConnInterface) SnowflakeServiceClient {
|
||||
return &snowflakeServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *snowflakeServiceClient) NextId(ctx context.Context, in *NextIdReq, opts ...grpc.CallOption) (*NextIdResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NextIdResp)
|
||||
err := c.cc.Invoke(ctx, SnowflakeService_NextId_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *snowflakeServiceClient) NextIds(ctx context.Context, in *NextIdsReq, opts ...grpc.CallOption) (*NextIdsResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NextIdsResp)
|
||||
err := c.cc.Invoke(ctx, SnowflakeService_NextIds_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SnowflakeServiceServer is the server API for SnowflakeService service.
|
||||
// All implementations must embed UnimplementedSnowflakeServiceServer
|
||||
// for forward compatibility.
|
||||
type SnowflakeServiceServer interface {
|
||||
NextId(context.Context, *NextIdReq) (*NextIdResp, error)
|
||||
NextIds(context.Context, *NextIdsReq) (*NextIdsResp, error)
|
||||
mustEmbedUnimplementedSnowflakeServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedSnowflakeServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSnowflakeServiceServer struct{}
|
||||
|
||||
func (UnimplementedSnowflakeServiceServer) NextId(context.Context, *NextIdReq) (*NextIdResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method NextId not implemented")
|
||||
}
|
||||
func (UnimplementedSnowflakeServiceServer) NextIds(context.Context, *NextIdsReq) (*NextIdsResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method NextIds not implemented")
|
||||
}
|
||||
func (UnimplementedSnowflakeServiceServer) mustEmbedUnimplementedSnowflakeServiceServer() {}
|
||||
func (UnimplementedSnowflakeServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSnowflakeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SnowflakeServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSnowflakeServiceServer interface {
|
||||
mustEmbedUnimplementedSnowflakeServiceServer()
|
||||
}
|
||||
|
||||
func RegisterSnowflakeServiceServer(s grpc.ServiceRegistrar, srv SnowflakeServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedSnowflakeServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SnowflakeService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SnowflakeService_NextId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NextIdReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SnowflakeServiceServer).NextId(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SnowflakeService_NextId_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SnowflakeServiceServer).NextId(ctx, req.(*NextIdReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SnowflakeService_NextIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NextIdsReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SnowflakeServiceServer).NextIds(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SnowflakeService_NextIds_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SnowflakeServiceServer).NextIds(ctx, req.(*NextIdsReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SnowflakeService_ServiceDesc is the grpc.ServiceDesc for SnowflakeService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SnowflakeService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "snowflake.SnowflakeService",
|
||||
HandlerType: (*SnowflakeServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "NextId",
|
||||
Handler: _SnowflakeService_NextId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NextIds",
|
||||
Handler: _SnowflakeService_NextIds_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "snowflake.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user