modify protobuf
This commit is contained in:
parent
059a853bc1
commit
a4da0cf29b
@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/skeris/appInit"
|
||||
"github.com/themakers/hlog"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"google.golang.org/grpc"
|
||||
"net"
|
||||
"penahub.gitlab.yandexcloud.net/external/trashlog/dal/clickhouse"
|
||||
trashlogProto "penahub.gitlab.yandexcloud.net/external/trashlog/proto/generated"
|
||||
"penahub.gitlab.yandexcloud.net/external/trashlog/sink"
|
||||
|
@ -1,16 +1,12 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.6.1
|
||||
// protoc v3.14.0
|
||||
// source: trashlog.proto
|
||||
|
||||
package trashlogProto
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@ -512,7 +508,7 @@ var file_trashlog_proto_rawDesc = []byte{
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x06, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65,
|
||||
0x12, 0x14, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00,
|
||||
0x52, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x32,
|
||||
0xd7, 0x01, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x12, 0x2e, 0x0a, 0x05,
|
||||
0x83, 0x02, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x12, 0x2e, 0x0a, 0x05,
|
||||
0x56, 0x61, 0x6c, 0x76, 0x65, 0x12, 0x10, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67,
|
||||
0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0f, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c,
|
||||
0x6f, 0x67, 0x2e, 0x44, 0x75, 0x6d, 0x6d, 0x79, 0x22, 0x00, 0x28, 0x01, 0x12, 0x37, 0x0a, 0x06,
|
||||
@ -525,9 +521,11 @@ var file_trashlog_proto_rawDesc = []byte{
|
||||
0x69, 0x65, 0x6c, 0x64, 0x73, 0x32, 0x41, 0x64, 0x64, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x05, 0x54,
|
||||
0x67, 0x4c, 0x6f, 0x67, 0x12, 0x10, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x2e,
|
||||
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0f, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f,
|
||||
0x67, 0x2e, 0x44, 0x75, 0x6d, 0x6d, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, 0x74,
|
||||
0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x67, 0x2e, 0x44, 0x75, 0x6d, 0x6d, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x50, 0x69, 0x6e,
|
||||
0x67, 0x12, 0x0f, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x2e, 0x44, 0x75, 0x6d,
|
||||
0x6d, 0x79, 0x1a, 0x0f, 0x2e, 0x74, 0x72, 0x61, 0x73, 0x68, 0x6c, 0x6f, 0x67, 0x2e, 0x44, 0x75,
|
||||
0x6d, 0x6d, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, 0x74, 0x72, 0x61, 0x73, 0x68,
|
||||
0x6c, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -567,12 +565,14 @@ var file_trashlog_proto_depIdxs = []int32{
|
||||
0, // 8: trashlog.Trashlog.Modify:input_type -> trashlog.Fields2Add
|
||||
2, // 9: trashlog.Trashlog.GetFields:input_type -> trashlog.Dummy
|
||||
3, // 10: trashlog.Trashlog.TgLog:input_type -> trashlog.Record
|
||||
2, // 11: trashlog.Trashlog.Valve:output_type -> trashlog.Dummy
|
||||
1, // 12: trashlog.Trashlog.Modify:output_type -> trashlog.NotModified
|
||||
0, // 13: trashlog.Trashlog.GetFields:output_type -> trashlog.Fields2Add
|
||||
2, // 14: trashlog.Trashlog.TgLog:output_type -> trashlog.Dummy
|
||||
11, // [11:15] is the sub-list for method output_type
|
||||
7, // [7:11] is the sub-list for method input_type
|
||||
2, // 11: trashlog.Trashlog.Ping:input_type -> trashlog.Dummy
|
||||
2, // 12: trashlog.Trashlog.Valve:output_type -> trashlog.Dummy
|
||||
1, // 13: trashlog.Trashlog.Modify:output_type -> trashlog.NotModified
|
||||
0, // 14: trashlog.Trashlog.GetFields:output_type -> trashlog.Fields2Add
|
||||
2, // 15: trashlog.Trashlog.TgLog:output_type -> trashlog.Dummy
|
||||
2, // 16: trashlog.Trashlog.Ping:output_type -> trashlog.Dummy
|
||||
12, // [12:17] is the sub-list for method output_type
|
||||
7, // [7:12] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
@ -682,226 +682,3 @@ func file_trashlog_proto_init() {
|
||||
file_trashlog_proto_goTypes = nil
|
||||
file_trashlog_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// TrashlogClient is the client API for Trashlog service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type TrashlogClient interface {
|
||||
Valve(ctx context.Context, opts ...grpc.CallOption) (Trashlog_ValveClient, error)
|
||||
Modify(ctx context.Context, in *Fields2Add, opts ...grpc.CallOption) (*NotModified, error)
|
||||
GetFields(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Fields2Add, error)
|
||||
TgLog(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Dummy, error)
|
||||
}
|
||||
|
||||
type trashlogClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTrashlogClient(cc grpc.ClientConnInterface) TrashlogClient {
|
||||
return &trashlogClient{cc}
|
||||
}
|
||||
|
||||
func (c *trashlogClient) Valve(ctx context.Context, opts ...grpc.CallOption) (Trashlog_ValveClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_Trashlog_serviceDesc.Streams[0], "/trashlog.Trashlog/Valve", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &trashlogValveClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Trashlog_ValveClient interface {
|
||||
Send(*Record) error
|
||||
CloseAndRecv() (*Dummy, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type trashlogValveClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *trashlogValveClient) Send(m *Record) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *trashlogValveClient) CloseAndRecv() (*Dummy, error) {
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := new(Dummy)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) Modify(ctx context.Context, in *Fields2Add, opts ...grpc.CallOption) (*NotModified, error) {
|
||||
out := new(NotModified)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/Modify", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) GetFields(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Fields2Add, error) {
|
||||
out := new(Fields2Add)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/GetFields", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) TgLog(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Dummy, error) {
|
||||
out := new(Dummy)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/TgLog", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TrashlogServer is the server API for Trashlog service.
|
||||
type TrashlogServer interface {
|
||||
Valve(Trashlog_ValveServer) error
|
||||
Modify(context.Context, *Fields2Add) (*NotModified, error)
|
||||
GetFields(context.Context, *Dummy) (*Fields2Add, error)
|
||||
TgLog(context.Context, *Record) (*Dummy, error)
|
||||
}
|
||||
|
||||
// UnimplementedTrashlogServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedTrashlogServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedTrashlogServer) Valve(Trashlog_ValveServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Valve not implemented")
|
||||
}
|
||||
func (*UnimplementedTrashlogServer) Modify(context.Context, *Fields2Add) (*NotModified, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (*UnimplementedTrashlogServer) GetFields(context.Context, *Dummy) (*Fields2Add, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetFields not implemented")
|
||||
}
|
||||
func (*UnimplementedTrashlogServer) TgLog(context.Context, *Record) (*Dummy, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method TgLog not implemented")
|
||||
}
|
||||
|
||||
func RegisterTrashlogServer(s *grpc.Server, srv TrashlogServer) {
|
||||
s.RegisterService(&_Trashlog_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Trashlog_Valve_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TrashlogServer).Valve(&trashlogValveServer{stream})
|
||||
}
|
||||
|
||||
type Trashlog_ValveServer interface {
|
||||
SendAndClose(*Dummy) error
|
||||
Recv() (*Record, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type trashlogValveServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *trashlogValveServer) SendAndClose(m *Dummy) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *trashlogValveServer) Recv() (*Record, error) {
|
||||
m := new(Record)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Trashlog_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Fields2Add)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).Modify(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/Modify",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).Modify(ctx, req.(*Fields2Add))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Trashlog_GetFields_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Dummy)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).GetFields(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/GetFields",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).GetFields(ctx, req.(*Dummy))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Trashlog_TgLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Record)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).TgLog(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/TgLog",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).TgLog(ctx, req.(*Record))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Trashlog_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "trashlog.Trashlog",
|
||||
HandlerType: (*TrashlogServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Modify",
|
||||
Handler: _Trashlog_Modify_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetFields",
|
||||
Handler: _Trashlog_GetFields_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TgLog",
|
||||
Handler: _Trashlog_TgLog_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Valve",
|
||||
Handler: _Trashlog_Valve_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "trashlog.proto",
|
||||
}
|
||||
|
280
proto/generated/trashlog_grpc.pb.go
Normal file
280
proto/generated/trashlog_grpc.pb.go
Normal file
@ -0,0 +1,280 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package trashlogProto
|
||||
|
||||
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
|
||||
|
||||
// TrashlogClient is the client API for Trashlog 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 TrashlogClient interface {
|
||||
Valve(ctx context.Context, opts ...grpc.CallOption) (Trashlog_ValveClient, error)
|
||||
Modify(ctx context.Context, in *Fields2Add, opts ...grpc.CallOption) (*NotModified, error)
|
||||
GetFields(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Fields2Add, error)
|
||||
TgLog(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Dummy, error)
|
||||
Ping(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Dummy, error)
|
||||
}
|
||||
|
||||
type trashlogClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTrashlogClient(cc grpc.ClientConnInterface) TrashlogClient {
|
||||
return &trashlogClient{cc}
|
||||
}
|
||||
|
||||
func (c *trashlogClient) Valve(ctx context.Context, opts ...grpc.CallOption) (Trashlog_ValveClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Trashlog_ServiceDesc.Streams[0], "/trashlog.Trashlog/Valve", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &trashlogValveClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Trashlog_ValveClient interface {
|
||||
Send(*Record) error
|
||||
CloseAndRecv() (*Dummy, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type trashlogValveClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *trashlogValveClient) Send(m *Record) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *trashlogValveClient) CloseAndRecv() (*Dummy, error) {
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := new(Dummy)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) Modify(ctx context.Context, in *Fields2Add, opts ...grpc.CallOption) (*NotModified, error) {
|
||||
out := new(NotModified)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/Modify", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) GetFields(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Fields2Add, error) {
|
||||
out := new(Fields2Add)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/GetFields", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) TgLog(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Dummy, error) {
|
||||
out := new(Dummy)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/TgLog", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *trashlogClient) Ping(ctx context.Context, in *Dummy, opts ...grpc.CallOption) (*Dummy, error) {
|
||||
out := new(Dummy)
|
||||
err := c.cc.Invoke(ctx, "/trashlog.Trashlog/Ping", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TrashlogServer is the server API for Trashlog service.
|
||||
// All implementations must embed UnimplementedTrashlogServer
|
||||
// for forward compatibility
|
||||
type TrashlogServer interface {
|
||||
Valve(Trashlog_ValveServer) error
|
||||
Modify(context.Context, *Fields2Add) (*NotModified, error)
|
||||
GetFields(context.Context, *Dummy) (*Fields2Add, error)
|
||||
TgLog(context.Context, *Record) (*Dummy, error)
|
||||
Ping(context.Context, *Dummy) (*Dummy, error)
|
||||
mustEmbedUnimplementedTrashlogServer()
|
||||
}
|
||||
|
||||
// UnimplementedTrashlogServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedTrashlogServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedTrashlogServer) Valve(Trashlog_ValveServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Valve not implemented")
|
||||
}
|
||||
func (UnimplementedTrashlogServer) Modify(context.Context, *Fields2Add) (*NotModified, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedTrashlogServer) GetFields(context.Context, *Dummy) (*Fields2Add, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetFields not implemented")
|
||||
}
|
||||
func (UnimplementedTrashlogServer) TgLog(context.Context, *Record) (*Dummy, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method TgLog not implemented")
|
||||
}
|
||||
func (UnimplementedTrashlogServer) Ping(context.Context, *Dummy) (*Dummy, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||
}
|
||||
func (UnimplementedTrashlogServer) mustEmbedUnimplementedTrashlogServer() {}
|
||||
|
||||
// UnsafeTrashlogServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TrashlogServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTrashlogServer interface {
|
||||
mustEmbedUnimplementedTrashlogServer()
|
||||
}
|
||||
|
||||
func RegisterTrashlogServer(s grpc.ServiceRegistrar, srv TrashlogServer) {
|
||||
s.RegisterService(&Trashlog_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Trashlog_Valve_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TrashlogServer).Valve(&trashlogValveServer{stream})
|
||||
}
|
||||
|
||||
type Trashlog_ValveServer interface {
|
||||
SendAndClose(*Dummy) error
|
||||
Recv() (*Record, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type trashlogValveServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *trashlogValveServer) SendAndClose(m *Dummy) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *trashlogValveServer) Recv() (*Record, error) {
|
||||
m := new(Record)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Trashlog_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Fields2Add)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).Modify(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/Modify",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).Modify(ctx, req.(*Fields2Add))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Trashlog_GetFields_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Dummy)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).GetFields(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/GetFields",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).GetFields(ctx, req.(*Dummy))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Trashlog_TgLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Record)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).TgLog(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/TgLog",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).TgLog(ctx, req.(*Record))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Trashlog_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Dummy)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TrashlogServer).Ping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/trashlog.Trashlog/Ping",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrashlogServer).Ping(ctx, req.(*Dummy))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Trashlog_ServiceDesc is the grpc.ServiceDesc for Trashlog service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Trashlog_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "trashlog.Trashlog",
|
||||
HandlerType: (*TrashlogServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Modify",
|
||||
Handler: _Trashlog_Modify_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetFields",
|
||||
Handler: _Trashlog_GetFields_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TgLog",
|
||||
Handler: _Trashlog_TgLog_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Ping",
|
||||
Handler: _Trashlog_Ping_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Valve",
|
||||
Handler: _Trashlog_Valve_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "trashlog.proto",
|
||||
}
|
@ -4,11 +4,12 @@ option go_package = ".;trashlogProto";
|
||||
|
||||
package trashlog;
|
||||
|
||||
service Trashlog{
|
||||
service Trashlog {
|
||||
rpc Valve(stream Record) returns (Dummy) {}
|
||||
rpc Modify(Fields2Add) returns (NotModified) {}
|
||||
rpc GetFields(Dummy) returns (Fields2Add) {}
|
||||
rpc TgLog(Record) returns (Dummy) {}
|
||||
rpc Ping(Dummy) returns (Dummy) {}
|
||||
}
|
||||
|
||||
message Fields2Add {
|
||||
|
@ -3,6 +3,7 @@ package sink
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/themakers/hlog"
|
||||
"penahub.gitlab.yandexcloud.net/external/trashlog/dal/clickhouse"
|
||||
"penahub.gitlab.yandexcloud.net/external/trashlog/model"
|
||||
@ -12,6 +13,7 @@ import (
|
||||
type Sink struct {
|
||||
logger hlog.Logger
|
||||
store *clickhouse.DAL
|
||||
trashlogProto.UnimplementedTrashlogServer
|
||||
}
|
||||
|
||||
type InfoMobileRec struct {
|
||||
@ -156,3 +158,7 @@ func Dto2daoValue(in *trashlogProto.Value) interface{} {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Sink) Ping(context.Context, *trashlogProto.Dummy) (*trashlogProto.Dummy, error) {
|
||||
return &trashlogProto.Dummy{}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user