From 496a45f85d1386d59d6ecb2fce2a59693fc2f85c Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 26 Nov 2019 17:20:00 +0100 Subject: [PATCH] chore: add GET /api/status page --- api/dvserver.proto | 8 + gen.sum | 2 +- internal/dvserver/api.go | 4 + internal/dvserver/dvserver.pb.go | 518 ++++++++++++++++++++++++++-- internal/dvserver/dvserver.pb.gw.go | 62 ++++ 5 files changed, 558 insertions(+), 36 deletions(-) diff --git a/api/dvserver.proto b/api/dvserver.proto index 1efb77505..dbe526e5d 100644 --- a/api/dvserver.proto +++ b/api/dvserver.proto @@ -17,6 +17,7 @@ service DepvizService { rpc Graph(Graph.Input) returns (Graph.Output) { option (google.api.http) = {get: "/graph"}; }; rpc StoreDump(StoreDump.Input) returns (StoreDump.Output) { option (google.api.http) = {get: "/store/dump"}; }; rpc Ping(Ping.Input) returns (Ping.Output) { option (google.api.http) = {get: "/ping"}; }; + rpc Status(Status.Input) returns (Status.Output) { option (google.api.http) = {get: "/status"}; }; } message Graph { @@ -44,4 +45,11 @@ message Ping { message Output { string message = 1; } +} + +message Status { + message Input {} + message Output { + bool everything_is_ok = 1 [(gogoproto.customname) = "EverythingIsOK"]; + } } \ No newline at end of file diff --git a/gen.sum b/gen.sum index a5c5a0c46..fc400990a 100644 --- a/gen.sum +++ b/gen.sum @@ -1,3 +1,3 @@ 4668890e2f9fc8852ff7696d493dab0d644fc5f4 ./api/dvmodel.proto -7a0c530fedad94d9d982eff0016224c6b7ac382a ./api/dvserver.proto c20a5a1da7ea5d90ef0507e1839e0ecc5c20c9d0 Makefile +f784b11d889417b3ce30d65744799a0e992e1201 ./api/dvserver.proto diff --git a/internal/dvserver/api.go b/internal/dvserver/api.go index bdb8069a7..17354636c 100644 --- a/internal/dvserver/api.go +++ b/internal/dvserver/api.go @@ -65,3 +65,7 @@ func (s *service) StoreDump(ctx context.Context, in *StoreDump_Input) (*StoreDum func (s *service) Ping(context.Context, *Ping_Input) (*Ping_Output, error) { return &Ping_Output{Message: "pong"}, nil } + +func (s *service) Status(context.Context, *Status_Input) (*Status_Output, error) { + return &Status_Output{EverythingIsOK: true}, nil +} diff --git a/internal/dvserver/dvserver.pb.go b/internal/dvserver/dvserver.pb.go index 10d24fbf5..d6348b309 100644 --- a/internal/dvserver/dvserver.pb.go +++ b/internal/dvserver/dvserver.pb.go @@ -419,6 +419,122 @@ func (m *Ping_Output) GetMessage() string { return "" } +type Status struct { +} + +func (m *Status) Reset() { *m = Status{} } +func (m *Status) String() string { return proto.CompactTextString(m) } +func (*Status) ProtoMessage() {} +func (*Status) Descriptor() ([]byte, []int) { + return fileDescriptor_af3aef303a4c4cd2, []int{3} +} +func (m *Status) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Status.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 *Status) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status.Merge(m, src) +} +func (m *Status) XXX_Size() int { + return m.Size() +} +func (m *Status) XXX_DiscardUnknown() { + xxx_messageInfo_Status.DiscardUnknown(m) +} + +var xxx_messageInfo_Status proto.InternalMessageInfo + +type Status_Input struct { +} + +func (m *Status_Input) Reset() { *m = Status_Input{} } +func (m *Status_Input) String() string { return proto.CompactTextString(m) } +func (*Status_Input) ProtoMessage() {} +func (*Status_Input) Descriptor() ([]byte, []int) { + return fileDescriptor_af3aef303a4c4cd2, []int{3, 0} +} +func (m *Status_Input) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status_Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Status_Input.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 *Status_Input) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status_Input.Merge(m, src) +} +func (m *Status_Input) XXX_Size() int { + return m.Size() +} +func (m *Status_Input) XXX_DiscardUnknown() { + xxx_messageInfo_Status_Input.DiscardUnknown(m) +} + +var xxx_messageInfo_Status_Input proto.InternalMessageInfo + +type Status_Output struct { + EverythingIsOK bool `protobuf:"varint,1,opt,name=everything_is_ok,json=everythingIsOk,proto3" json:"everything_is_ok,omitempty"` +} + +func (m *Status_Output) Reset() { *m = Status_Output{} } +func (m *Status_Output) String() string { return proto.CompactTextString(m) } +func (*Status_Output) ProtoMessage() {} +func (*Status_Output) Descriptor() ([]byte, []int) { + return fileDescriptor_af3aef303a4c4cd2, []int{3, 1} +} +func (m *Status_Output) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status_Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Status_Output.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 *Status_Output) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status_Output.Merge(m, src) +} +func (m *Status_Output) XXX_Size() int { + return m.Size() +} +func (m *Status_Output) XXX_DiscardUnknown() { + xxx_messageInfo_Status_Output.DiscardUnknown(m) +} + +var xxx_messageInfo_Status_Output proto.InternalMessageInfo + +func (m *Status_Output) GetEverythingIsOK() bool { + if m != nil { + return m.EverythingIsOK + } + return false +} + func init() { proto.RegisterType((*Graph)(nil), "depviz.server.Graph") proto.RegisterType((*Graph_Input)(nil), "depviz.server.Graph.Input") @@ -429,46 +545,54 @@ func init() { proto.RegisterType((*Ping)(nil), "depviz.server.Ping") proto.RegisterType((*Ping_Input)(nil), "depviz.server.Ping.Input") proto.RegisterType((*Ping_Output)(nil), "depviz.server.Ping.Output") + proto.RegisterType((*Status)(nil), "depviz.server.Status") + proto.RegisterType((*Status_Input)(nil), "depviz.server.Status.Input") + proto.RegisterType((*Status_Output)(nil), "depviz.server.Status.Output") } func init() { proto.RegisterFile("dvserver.proto", fileDescriptor_af3aef303a4c4cd2) } var fileDescriptor_af3aef303a4c4cd2 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x4f, 0x8f, 0x12, 0x3d, - 0x1c, 0xc7, 0x77, 0xd8, 0x9d, 0x65, 0x29, 0x81, 0xe7, 0x49, 0x89, 0xc9, 0x38, 0x9a, 0x81, 0x70, - 0x62, 0x0f, 0x4c, 0x13, 0xb8, 0x79, 0x44, 0x8c, 0x21, 0x31, 0x91, 0x0c, 0x26, 0x26, 0x5e, 0x48, - 0x99, 0xa9, 0x65, 0xb2, 0xc3, 0xb4, 0x69, 0x3b, 0xe0, 0x7a, 0xf4, 0x15, 0x6c, 0xf4, 0x4d, 0x79, - 0xdc, 0xe8, 0xc5, 0x93, 0x31, 0xe0, 0x0b, 0x31, 0xd3, 0x16, 0xdc, 0xdd, 0xe0, 0x6d, 0xbe, 0x7f, - 0xfa, 0x29, 0xbf, 0xb6, 0x80, 0x66, 0xb2, 0x96, 0x44, 0xac, 0x89, 0x08, 0xb9, 0x60, 0x8a, 0xc1, - 0x46, 0x42, 0xf8, 0x3a, 0xfd, 0x18, 0x1a, 0xd3, 0x7f, 0x4a, 0x19, 0xa3, 0x19, 0x41, 0x98, 0xa7, - 0x08, 0xe7, 0x39, 0x53, 0x58, 0xa5, 0x2c, 0x97, 0xa6, 0xec, 0xf7, 0x69, 0xaa, 0x96, 0xc5, 0x22, - 0x8c, 0xd9, 0x0a, 0x51, 0x46, 0x19, 0xd2, 0xf6, 0xa2, 0x78, 0xaf, 0x95, 0x16, 0xfa, 0xcb, 0xd6, - 0x67, 0x77, 0xeb, 0x82, 0xc7, 0x7d, 0x12, 0x33, 0x79, 0x2d, 0x15, 0xb1, 0x92, 0x62, 0x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, 0x38, 0xd7, 0x4f, - 0x7d, 0xf8, 0x27, 0x00, 0x00, 0xff, 0xff, 0x80, 0x44, 0x42, 0xe4, 0xbc, 0x03, 0x00, 0x00, + // 620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xc1, 0x6e, 0xda, 0x4c, + 0x14, 0x85, 0x63, 0x12, 0x20, 0x0c, 0x82, 0x44, 0x13, 0xfd, 0x92, 0x7f, 0x27, 0x32, 0x88, 0x15, + 0x59, 0xe0, 0x91, 0xc8, 0xae, 0xea, 0x8a, 0x26, 0xad, 0x50, 0x2b, 0x25, 0x32, 0x91, 0xaa, 0x76, + 0x83, 0x06, 0xfb, 0x76, 0xb0, 0x00, 0x8f, 0xe5, 0x19, 0x93, 0xa6, 0xcb, 0x3e, 0x41, 0xa4, 0xbe, + 0x54, 0x97, 0x51, 0xbb, 0xe9, 0x2a, 0xaa, 0x48, 0x17, 0x7d, 0x8c, 0xca, 0x33, 0x03, 0x21, 0x29, + 0xdd, 0xf9, 0x9e, 0x73, 0xee, 0x37, 0xd7, 0xd7, 0x03, 0xa8, 0x1e, 0xce, 0x05, 0xa4, 0x73, 0x48, + 0xbd, 0x24, 0xe5, 0x92, 0xe3, 0x5a, 0x08, 0xc9, 0x3c, 0xfa, 0xe4, 0x69, 0xd1, 0x39, 0x62, 0x9c, + 0xb3, 0x29, 0x10, 0x9a, 0x44, 0x84, 0xc6, 0x31, 0x97, 0x54, 0x46, 0x3c, 0x16, 0x3a, 0xec, 0x74, + 0x58, 0x24, 0xc7, 0xd9, 0xc8, 0x0b, 0xf8, 0x8c, 0x30, 0xce, 0x38, 0x51, 0xf2, 0x28, 0xfb, 0xa0, + 0x2a, 0x55, 0xa8, 0x27, 0x13, 0x1f, 0xac, 0xc7, 0xd3, 0x24, 0xe8, 0x40, 0xc0, 0xc5, 0xb5, 0x90, + 0x60, 0x4a, 0x46, 0x25, 0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9, + 0x32, 0xcc, 0x9a, 0x62, 0x96, 0x71, 0x91, 0x24, 0x39, 0xe5, 0x72, 0xb9, 0x6f, 0x7c, 0xf8, 0xd7, + 0x34, 0xb9, 0x6c, 0x88, 0x47, 0x9b, 0x4d, 0xc3, 0xdc, 0x53, 0xcc, 0x0a, 0x2e, 0x13, 0xa1, 0xf4, + 0xde, 0xb3, 0xaf, 0x0b, 0xd7, 0xba, 0x5d, 0xb8, 0xd6, 0xcf, 0x85, 0x6b, 0xdd, 0xdc, 0xbb, 0x5b, + 0xb7, 0xf7, 0xee, 0xd6, 0x8f, 0x7b, 0x77, 0xeb, 0x7d, 0x73, 0xc6, 0xb3, 0xa9, 0x17, 0x71, 0xa2, + 0x79, 0x24, 0x8a, 0xf5, 0x85, 0x25, 0xcb, 0xbf, 0x96, 0x51, 0x49, 0xfd, 0x36, 0x4f, 0xfe, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x3b, 0xa0, 0xa4, 0x1d, 0x6d, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -486,6 +610,7 @@ type DepvizServiceClient interface { Graph(ctx context.Context, in *Graph_Input, opts ...grpc.CallOption) (*Graph_Output, error) StoreDump(ctx context.Context, in *StoreDump_Input, opts ...grpc.CallOption) (*StoreDump_Output, error) Ping(ctx context.Context, in *Ping_Input, opts ...grpc.CallOption) (*Ping_Output, error) + Status(ctx context.Context, in *Status_Input, opts ...grpc.CallOption) (*Status_Output, error) } type depvizServiceClient struct { @@ -523,11 +648,21 @@ func (c *depvizServiceClient) Ping(ctx context.Context, in *Ping_Input, opts ... return out, nil } +func (c *depvizServiceClient) Status(ctx context.Context, in *Status_Input, opts ...grpc.CallOption) (*Status_Output, error) { + out := new(Status_Output) + err := c.cc.Invoke(ctx, "/depviz.server.DepvizService/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DepvizServiceServer is the server API for DepvizService service. type DepvizServiceServer interface { Graph(context.Context, *Graph_Input) (*Graph_Output, error) StoreDump(context.Context, *StoreDump_Input) (*StoreDump_Output, error) Ping(context.Context, *Ping_Input) (*Ping_Output, error) + Status(context.Context, *Status_Input) (*Status_Output, error) } // UnimplementedDepvizServiceServer can be embedded to have forward compatible implementations. @@ -543,6 +678,9 @@ func (*UnimplementedDepvizServiceServer) StoreDump(ctx context.Context, req *Sto func (*UnimplementedDepvizServiceServer) Ping(ctx context.Context, req *Ping_Input) (*Ping_Output, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } +func (*UnimplementedDepvizServiceServer) Status(ctx context.Context, req *Status_Input) (*Status_Output, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} func RegisterDepvizServiceServer(s *grpc.Server, srv DepvizServiceServer) { s.RegisterService(&_DepvizService_serviceDesc, srv) @@ -602,6 +740,24 @@ func _DepvizService_Ping_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _DepvizService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Status_Input) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DepvizServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/depviz.server.DepvizService/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DepvizServiceServer).Status(ctx, req.(*Status_Input)) + } + return interceptor(ctx, in, info, handler) +} + var _DepvizService_serviceDesc = grpc.ServiceDesc{ ServiceName: "depviz.server.DepvizService", HandlerType: (*DepvizServiceServer)(nil), @@ -618,6 +774,10 @@ var _DepvizService_serviceDesc = grpc.ServiceDesc{ MethodName: "Ping", Handler: _DepvizService_Ping_Handler, }, + { + MethodName: "Status", + Handler: _DepvizService_Status_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dvserver.proto", @@ -912,6 +1072,85 @@ func (m *Ping_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Status) 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 *Status) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *Status_Input) 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 *Status_Input) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Status_Input) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *Status_Output) 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 *Status_Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Status_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EverythingIsOK { + i-- + if m.EverythingIsOK { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintDvserver(dAtA []byte, offset int, v uint64) int { offset -= sovDvserver(v) base := offset @@ -1036,6 +1275,36 @@ func (m *Ping_Output) Size() (n int) { return n } +func (m *Status) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *Status_Input) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *Status_Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EverythingIsOK { + n += 2 + } + return n +} + func sovDvserver(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1733,6 +2002,185 @@ func (m *Ping_Output) Unmarshal(dAtA []byte) error { } return nil } +func (m *Status) 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 ErrIntOverflowDvserver + } + 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: Status: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipDvserver(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Status_Input) 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 ErrIntOverflowDvserver + } + 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: Input: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Input: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipDvserver(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Status_Output) 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 ErrIntOverflowDvserver + } + 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: Output: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Output: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EverythingIsOK", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDvserver + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EverythingIsOK = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipDvserver(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDvserver + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipDvserver(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/internal/dvserver/dvserver.pb.gw.go b/internal/dvserver/dvserver.pb.gw.go index 587c5a20d..6da0d1f27 100644 --- a/internal/dvserver/dvserver.pb.gw.go +++ b/internal/dvserver/dvserver.pb.gw.go @@ -97,6 +97,24 @@ func local_request_DepvizService_Ping_0(ctx context.Context, marshaler runtime.M } +func request_DepvizService_Status_0(ctx context.Context, marshaler runtime.Marshaler, client DepvizServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Status_Input + var metadata runtime.ServerMetadata + + msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DepvizService_Status_0(ctx context.Context, marshaler runtime.Marshaler, server DepvizServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Status_Input + var metadata runtime.ServerMetadata + + msg, err := server.Status(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDepvizServiceHandlerServer registers the http handlers for service DepvizService to "mux". // UnaryRPC :call DepvizServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -162,6 +180,26 @@ func RegisterDepvizServiceHandlerServer(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_DepvizService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DepvizService_Status_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DepvizService_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -263,6 +301,26 @@ func RegisterDepvizServiceHandlerClient(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_DepvizService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DepvizService_Status_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DepvizService_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -272,6 +330,8 @@ var ( pattern_DepvizService_StoreDump_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"store", "dump"}, "", runtime.AssumeColonVerbOpt(true))) pattern_DepvizService_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ping"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_DepvizService_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"status"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -280,4 +340,6 @@ var ( forward_DepvizService_StoreDump_0 = runtime.ForwardResponseMessage forward_DepvizService_Ping_0 = runtime.ForwardResponseMessage + + forward_DepvizService_Status_0 = runtime.ForwardResponseMessage )