added server; initial cluster state
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
6fed0fa858
commit
562f1caa54
704 changed files with 361956 additions and 534 deletions
22
api/v1/doc.go
Normal file
22
api/v1/doc.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
Copyright 2019 Stellar Project
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies
|
||||
or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package v1
|
390
api/v1/heimdall.pb.go
Normal file
390
api/v1/heimdall.pb.go
Normal file
|
@ -0,0 +1,390 @@
|
|||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: github.com/stellarproject/heimdall/api/v1/heimdall.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type Master struct {
|
||||
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
GRPCAddress string `protobuf:"bytes,2,opt,name=grpc_address,json=grpcAddress,proto3" json:"grpc_address,omitempty"`
|
||||
RedisURL string `protobuf:"bytes,3,opt,name=redis_url,json=redisUrl,proto3" json:"redis_url,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Master) Reset() { *m = Master{} }
|
||||
func (m *Master) String() string { return proto.CompactTextString(m) }
|
||||
func (*Master) ProtoMessage() {}
|
||||
func (*Master) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{0}
|
||||
}
|
||||
func (m *Master) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Master.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Master) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Master.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Master) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Master.Merge(m, src)
|
||||
}
|
||||
func (m *Master) XXX_Size() int {
|
||||
return xxx_messageInfo_Master.Size(m)
|
||||
}
|
||||
func (m *Master) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Master.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Master proto.InternalMessageInfo
|
||||
|
||||
func (m *Master) GetID() string {
|
||||
if m != nil {
|
||||
return m.ID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Master) GetGRPCAddress() string {
|
||||
if m != nil {
|
||||
return m.GRPCAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Master) GetRedisURL() string {
|
||||
if m != nil {
|
||||
return m.RedisURL
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ConnectRequest struct {
|
||||
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ConnectRequest) Reset() { *m = ConnectRequest{} }
|
||||
func (m *ConnectRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConnectRequest) ProtoMessage() {}
|
||||
func (*ConnectRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{1}
|
||||
}
|
||||
func (m *ConnectRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ConnectRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ConnectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ConnectRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ConnectRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ConnectRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ConnectRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ConnectRequest.Size(m)
|
||||
}
|
||||
func (m *ConnectRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ConnectRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ConnectRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ConnectRequest) GetID() string {
|
||||
if m != nil {
|
||||
return m.ID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ConnectResponse struct {
|
||||
Master *Master `protobuf:"bytes,1,opt,name=master,proto3" json:"master,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ConnectResponse) Reset() { *m = ConnectResponse{} }
|
||||
func (m *ConnectResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConnectResponse) ProtoMessage() {}
|
||||
func (*ConnectResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{2}
|
||||
}
|
||||
func (m *ConnectResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ConnectResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ConnectResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ConnectResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ConnectResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ConnectResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ConnectResponse.Size(m)
|
||||
}
|
||||
func (m *ConnectResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ConnectResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ConnectResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ConnectResponse) GetMaster() *Master {
|
||||
if m != nil {
|
||||
return m.Master
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Node) Reset() { *m = Node{} }
|
||||
func (m *Node) String() string { return proto.CompactTextString(m) }
|
||||
func (*Node) ProtoMessage() {}
|
||||
func (*Node) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{3}
|
||||
}
|
||||
func (m *Node) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Node.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Node.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Node) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Node.Merge(m, src)
|
||||
}
|
||||
func (m *Node) XXX_Size() int {
|
||||
return xxx_messageInfo_Node.Size(m)
|
||||
}
|
||||
func (m *Node) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Node.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Node proto.InternalMessageInfo
|
||||
|
||||
func (m *Node) GetID() string {
|
||||
if m != nil {
|
||||
return m.ID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Node) GetAddr() string {
|
||||
if m != nil {
|
||||
return m.Addr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type NodesRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NodesRequest) Reset() { *m = NodesRequest{} }
|
||||
func (m *NodesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodesRequest) ProtoMessage() {}
|
||||
func (*NodesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{4}
|
||||
}
|
||||
func (m *NodesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodesRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NodesRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NodesRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NodesRequest.Merge(m, src)
|
||||
}
|
||||
func (m *NodesRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_NodesRequest.Size(m)
|
||||
}
|
||||
func (m *NodesRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NodesRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NodesRequest proto.InternalMessageInfo
|
||||
|
||||
type NodesResponse struct {
|
||||
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NodesResponse) Reset() { *m = NodesResponse{} }
|
||||
func (m *NodesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodesResponse) ProtoMessage() {}
|
||||
func (*NodesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6184fc395da86b1, []int{5}
|
||||
}
|
||||
func (m *NodesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodesResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NodesResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NodesResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NodesResponse.Merge(m, src)
|
||||
}
|
||||
func (m *NodesResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_NodesResponse.Size(m)
|
||||
}
|
||||
func (m *NodesResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NodesResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NodesResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *NodesResponse) GetNodes() []*Node {
|
||||
if m != nil {
|
||||
return m.Nodes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Master)(nil), "io.stellarproject.heimdall.api.v1.Master")
|
||||
proto.RegisterType((*ConnectRequest)(nil), "io.stellarproject.heimdall.api.v1.ConnectRequest")
|
||||
proto.RegisterType((*ConnectResponse)(nil), "io.stellarproject.heimdall.api.v1.ConnectResponse")
|
||||
proto.RegisterType((*Node)(nil), "io.stellarproject.heimdall.api.v1.Node")
|
||||
proto.RegisterType((*NodesRequest)(nil), "io.stellarproject.heimdall.api.v1.NodesRequest")
|
||||
proto.RegisterType((*NodesResponse)(nil), "io.stellarproject.heimdall.api.v1.NodesResponse")
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/stellarproject/heimdall/api/v1/heimdall.proto", fileDescriptor_b6184fc395da86b1)
|
||||
}
|
||||
|
||||
var fileDescriptor_b6184fc395da86b1 = []byte{
|
||||
// 354 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6b, 0xc2, 0x30,
|
||||
0x14, 0xc6, 0xb1, 0xba, 0x4e, 0x5f, 0x9d, 0x42, 0x18, 0xa3, 0x78, 0xd1, 0xf5, 0x32, 0x85, 0x91,
|
||||
0xd2, 0xee, 0x32, 0x18, 0x3b, 0xa8, 0x83, 0x6d, 0xb0, 0xc9, 0x08, 0xf3, 0xb2, 0x8b, 0xd4, 0x36,
|
||||
0xd4, 0x8c, 0xda, 0x74, 0x49, 0xf5, 0x34, 0xd8, 0x7f, 0xea, 0xc1, 0xbf, 0x64, 0x34, 0x0d, 0x82,
|
||||
0x07, 0x99, 0xbb, 0xe5, 0xbd, 0x7c, 0xbf, 0xc7, 0xf7, 0x3d, 0x1e, 0xdc, 0xc6, 0x2c, 0x5f, 0xac,
|
||||
0xe6, 0x38, 0xe4, 0x4b, 0x57, 0xe6, 0x34, 0x49, 0x02, 0x91, 0x09, 0xfe, 0x49, 0xc3, 0xdc, 0x5d,
|
||||
0x50, 0xb6, 0x8c, 0x82, 0x24, 0x71, 0x83, 0x8c, 0xb9, 0x6b, 0x6f, 0x57, 0xe3, 0x4c, 0xf0, 0x9c,
|
||||
0xa3, 0x4b, 0xc6, 0xf1, 0x3e, 0x81, 0x77, 0x8a, 0x20, 0x63, 0x78, 0xed, 0x75, 0xce, 0x63, 0x1e,
|
||||
0x73, 0xa5, 0x76, 0x8b, 0x57, 0x09, 0x3a, 0x3f, 0x60, 0xbe, 0x06, 0x32, 0xa7, 0x02, 0x5d, 0x80,
|
||||
0xc1, 0x22, 0xbb, 0xd2, 0xab, 0xf4, 0x1b, 0x23, 0x73, 0xbb, 0xe9, 0x1a, 0xcf, 0x0f, 0xc4, 0x60,
|
||||
0x11, 0xf2, 0xa1, 0x19, 0x8b, 0x2c, 0x9c, 0x05, 0x51, 0x24, 0xa8, 0x94, 0xb6, 0xa1, 0x14, 0xed,
|
||||
0xed, 0xa6, 0x6b, 0x3d, 0x92, 0xb7, 0xf1, 0xb0, 0x6c, 0x13, 0xab, 0x10, 0xe9, 0x02, 0x0d, 0xa0,
|
||||
0x21, 0x68, 0xc4, 0xe4, 0x6c, 0x25, 0x12, 0xbb, 0xaa, 0x80, 0xe6, 0x76, 0xd3, 0xad, 0x93, 0xa2,
|
||||
0x39, 0x25, 0x2f, 0xa4, 0xae, 0xbe, 0xa7, 0x22, 0x71, 0xfa, 0xd0, 0x1a, 0xf3, 0x34, 0xa5, 0x61,
|
||||
0x4e, 0xe8, 0xd7, 0x8a, 0xca, 0xfc, 0x90, 0x11, 0xe7, 0x1d, 0xda, 0x3b, 0xa5, 0xcc, 0x78, 0x2a,
|
||||
0x29, 0x1a, 0x82, 0xb9, 0x54, 0xee, 0x95, 0xdc, 0xf2, 0x07, 0xf8, 0xcf, 0x3d, 0xe0, 0x32, 0x2e,
|
||||
0xd1, 0xa0, 0xe3, 0x43, 0x6d, 0xc2, 0x23, 0x7a, 0x30, 0x3e, 0x82, 0x5a, 0x91, 0xbc, 0x8c, 0x4d,
|
||||
0xd4, 0xdb, 0x69, 0x41, 0xb3, 0x60, 0xa4, 0x76, 0xec, 0x4c, 0xe0, 0x4c, 0xd7, 0xda, 0xd7, 0x3d,
|
||||
0x9c, 0xa4, 0x45, 0xc3, 0xae, 0xf4, 0xaa, 0x7d, 0xcb, 0xbf, 0x3a, 0xc2, 0x56, 0x31, 0x80, 0x94,
|
||||
0x94, 0xff, 0x0d, 0xf5, 0x27, 0xfd, 0x8d, 0x32, 0x38, 0xd5, 0xa9, 0x91, 0x77, 0xc4, 0x98, 0xfd,
|
||||
0x5d, 0x76, 0xfc, 0xff, 0x20, 0xa5, 0xf9, 0x11, 0xfe, 0xb8, 0x3e, 0xfa, 0x0e, 0xef, 0xd6, 0xde,
|
||||
0xdc, 0x54, 0x97, 0x74, 0xf3, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x3d, 0x45, 0x9b, 0xbe, 0x02,
|
||||
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
|
||||
|
||||
// HeimdallClient is the client API for Heimdall service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type HeimdallClient interface {
|
||||
Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error)
|
||||
}
|
||||
|
||||
type heimdallClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewHeimdallClient(cc *grpc.ClientConn) HeimdallClient {
|
||||
return &heimdallClient{cc}
|
||||
}
|
||||
|
||||
func (c *heimdallClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) {
|
||||
out := new(ConnectResponse)
|
||||
err := c.cc.Invoke(ctx, "/io.stellarproject.heimdall.api.v1.Heimdall/Connect", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HeimdallServer is the server API for Heimdall service.
|
||||
type HeimdallServer interface {
|
||||
Connect(context.Context, *ConnectRequest) (*ConnectResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedHeimdallServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedHeimdallServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedHeimdallServer) Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
|
||||
func RegisterHeimdallServer(s *grpc.Server, srv HeimdallServer) {
|
||||
s.RegisterService(&_Heimdall_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Heimdall_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ConnectRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HeimdallServer).Connect(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/io.stellarproject.heimdall.api.v1.Heimdall/Connect",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HeimdallServer).Connect(ctx, req.(*ConnectRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Heimdall_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "io.stellarproject.heimdall.api.v1.Heimdall",
|
||||
HandlerType: (*HeimdallServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Connect",
|
||||
Handler: _Heimdall_Connect_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/stellarproject/heimdall/api/v1/heimdall.proto",
|
||||
}
|
40
api/v1/heimdall.proto
Normal file
40
api/v1/heimdall.proto
Normal file
|
@ -0,0 +1,40 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package io.stellarproject.heimdall.api.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
//import "google/protobuf/empty.proto";
|
||||
//import "google/protobuf/any.proto";
|
||||
|
||||
option go_package = "github.com/stellarproject/heimdall/api/v1;v1";
|
||||
|
||||
service Heimdall {
|
||||
rpc Connect(ConnectRequest) returns (ConnectResponse);
|
||||
//rpc Nodes(NodesRequest) returns (NodesResponse);
|
||||
//rpc Peers(PeersRequest) returns (PeersResponse);
|
||||
}
|
||||
|
||||
message Master {
|
||||
string id = 1 [(gogoproto.customname) = "ID"];
|
||||
string grpc_address = 2 [(gogoproto.customname) = "GRPCAddress"];
|
||||
string redis_url = 3 [(gogoproto.customname) = "RedisURL"];
|
||||
}
|
||||
|
||||
message ConnectRequest {
|
||||
string id = 1 [(gogoproto.customname) = "ID"];
|
||||
}
|
||||
|
||||
message ConnectResponse {
|
||||
Master master = 1;
|
||||
}
|
||||
|
||||
message Node {
|
||||
string id = 1 [(gogoproto.customname) = "ID"];
|
||||
string addr = 2;
|
||||
}
|
||||
|
||||
message NodesRequest {}
|
||||
|
||||
message NodesResponse {
|
||||
repeated Node nodes = 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue