mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 20:20:05 +00:00
72dc43989f
* implement validator logs stream * fix test * tidy * proto regen * add logs stream to the beacon node * beacon logs working * impl * pass test * gaz * rem lock * fix space
453 lines
12 KiB
Go
Executable File
Generated
453 lines
12 KiB
Go
Executable File
Generated
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: proto/beacon/rpc/v1/health.proto
|
|
|
|
package ethereum_beacon_rpc_v1
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
|
|
proto "github.com/gogo/protobuf/proto"
|
|
types "github.com/gogo/protobuf/types"
|
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type LogsResponse struct {
|
|
Logs []string `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *LogsResponse) Reset() { *m = LogsResponse{} }
|
|
func (m *LogsResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*LogsResponse) ProtoMessage() {}
|
|
func (*LogsResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_2e4b7e98e3e10444, []int{0}
|
|
}
|
|
func (m *LogsResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *LogsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_LogsResponse.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *LogsResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_LogsResponse.Merge(m, src)
|
|
}
|
|
func (m *LogsResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *LogsResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_LogsResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_LogsResponse proto.InternalMessageInfo
|
|
|
|
func (m *LogsResponse) GetLogs() []string {
|
|
if m != nil {
|
|
return m.Logs
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*LogsResponse)(nil), "ethereum.beacon.rpc.v1.LogsResponse")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("proto/beacon/rpc/v1/health.proto", fileDescriptor_2e4b7e98e3e10444) }
|
|
|
|
var fileDescriptor_2e4b7e98e3e10444 = []byte{
|
|
// 249 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x28, 0xca, 0x2f,
|
|
0xc9, 0xd7, 0x4f, 0x4a, 0x4d, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x33, 0xd4,
|
|
0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0xd0, 0x03, 0x4b, 0x09, 0x89, 0xa5, 0x96, 0x64, 0xa4, 0x16,
|
|
0xa5, 0x96, 0xe6, 0xea, 0x41, 0x14, 0xe9, 0x15, 0x15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, 0x40, 0x00, 0x00, 0x00, 0xff,
|
|
0xff, 0xb7, 0x40, 0x67, 0x57, 0x38, 0x01, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// 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.SupportPackageIsVersion4
|
|
|
|
// HealthClient is the client API for Health service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type HealthClient interface {
|
|
StreamBeaconLogs(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Health_StreamBeaconLogsClient, error)
|
|
}
|
|
|
|
type healthClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewHealthClient(cc *grpc.ClientConn) HealthClient {
|
|
return &healthClient{cc}
|
|
}
|
|
|
|
func (c *healthClient) StreamBeaconLogs(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Health_StreamBeaconLogsClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Health_serviceDesc.Streams[0], "/ethereum.beacon.rpc.v1.Health/StreamBeaconLogs", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &healthStreamBeaconLogsClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Health_StreamBeaconLogsClient interface {
|
|
Recv() (*LogsResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type healthStreamBeaconLogsClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *healthStreamBeaconLogsClient) Recv() (*LogsResponse, error) {
|
|
m := new(LogsResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// HealthServer is the server API for Health service.
|
|
type HealthServer interface {
|
|
StreamBeaconLogs(*types.Empty, Health_StreamBeaconLogsServer) error
|
|
}
|
|
|
|
// UnimplementedHealthServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedHealthServer struct {
|
|
}
|
|
|
|
func (*UnimplementedHealthServer) StreamBeaconLogs(req *types.Empty, srv Health_StreamBeaconLogsServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method StreamBeaconLogs not implemented")
|
|
}
|
|
|
|
func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
|
|
s.RegisterService(&_Health_serviceDesc, srv)
|
|
}
|
|
|
|
func _Health_StreamBeaconLogs_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(types.Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(HealthServer).StreamBeaconLogs(m, &healthStreamBeaconLogsServer{stream})
|
|
}
|
|
|
|
type Health_StreamBeaconLogsServer interface {
|
|
Send(*LogsResponse) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type healthStreamBeaconLogsServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *healthStreamBeaconLogsServer) Send(m *LogsResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _Health_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ethereum.beacon.rpc.v1.Health",
|
|
HandlerType: (*HealthServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamBeaconLogs",
|
|
Handler: _Health_StreamBeaconLogs_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "proto/beacon/rpc/v1/health.proto",
|
|
}
|
|
|
|
func (m *LogsResponse) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *LogsResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *LogsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.Logs) > 0 {
|
|
for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Logs[iNdEx])
|
|
copy(dAtA[i:], m.Logs[iNdEx])
|
|
i = encodeVarintHealth(dAtA, i, uint64(len(m.Logs[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintHealth(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovHealth(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *LogsResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Logs) > 0 {
|
|
for _, s := range m.Logs {
|
|
l = len(s)
|
|
n += 1 + l + sovHealth(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovHealth(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozHealth(x uint64) (n int) {
|
|
return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *LogsResponse) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowHealth
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: LogsResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: LogsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowHealth
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthHealth
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthHealth
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Logs = append(m.Logs, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipHealth(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthHealth
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthHealth
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipHealth(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
depth := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowHealth
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowHealth
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 1:
|
|
iNdEx += 8
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowHealth
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthHealth
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupHealth
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthHealth
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group")
|
|
)
|