powergate: github.com/textileio/powergate/net/rpc Index | Files

package rpc

import "github.com/textileio/powergate/net/rpc"

Index

Package Files

rpc.go rpc.pb.go

Variables

var (
    Connectedness_name = map[int32]string{
        0:  "CONNECTEDNESS_UNSPECIFIED",
        1:  "CONNECTEDNESS_NOT_CONNECTED",
        2:  "CONNECTEDNESS_CONNECTED",
        3:  "CONNECTEDNESS_CAN_CONNECT",
        4:  "CONNECTEDNESS_CANNOT_CONNECT",
        5:  "CONNECTEDNESS_ERROR",
    }
    Connectedness_value = map[string]int32{
        "CONNECTEDNESS_UNSPECIFIED":    0,
        "CONNECTEDNESS_NOT_CONNECTED":  1,
        "CONNECTEDNESS_CONNECTED":      2,
        "CONNECTEDNESS_CAN_CONNECT":    3,
        "CONNECTEDNESS_CANNOT_CONNECT": 4,
        "CONNECTEDNESS_ERROR":          5,
    }
)

Enum value maps for Connectedness.

var File_net_rpc_rpc_proto protoreflect.FileDescriptor

func RegisterRPCServiceServer Uses

func RegisterRPCServiceServer(s *grpc.Server, srv RPCServiceServer)

type ConnectPeerRequest Uses

type ConnectPeerRequest struct {
    PeerInfo *PeerAddrInfo `protobuf:"bytes,1,opt,name=peer_info,json=peerInfo,proto3" json:"peer_info,omitempty"`
    // contains filtered or unexported fields
}

func (*ConnectPeerRequest) Descriptor Uses

func (*ConnectPeerRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConnectPeerRequest.ProtoReflect.Descriptor instead.

func (*ConnectPeerRequest) GetPeerInfo Uses

func (x *ConnectPeerRequest) GetPeerInfo() *PeerAddrInfo

func (*ConnectPeerRequest) ProtoMessage Uses

func (*ConnectPeerRequest) ProtoMessage()

func (*ConnectPeerRequest) ProtoReflect Uses

func (x *ConnectPeerRequest) ProtoReflect() protoreflect.Message

func (*ConnectPeerRequest) Reset Uses

func (x *ConnectPeerRequest) Reset()

func (*ConnectPeerRequest) String Uses

func (x *ConnectPeerRequest) String() string

type ConnectPeerResponse Uses

type ConnectPeerResponse struct {
    // contains filtered or unexported fields
}

func (*ConnectPeerResponse) Descriptor Uses

func (*ConnectPeerResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConnectPeerResponse.ProtoReflect.Descriptor instead.

func (*ConnectPeerResponse) ProtoMessage Uses

func (*ConnectPeerResponse) ProtoMessage()

func (*ConnectPeerResponse) ProtoReflect Uses

func (x *ConnectPeerResponse) ProtoReflect() protoreflect.Message

func (*ConnectPeerResponse) Reset Uses

func (x *ConnectPeerResponse) Reset()

func (*ConnectPeerResponse) String Uses

func (x *ConnectPeerResponse) String() string

type Connectedness Uses

type Connectedness int32
const (
    Connectedness_CONNECTEDNESS_UNSPECIFIED    Connectedness = 0
    Connectedness_CONNECTEDNESS_NOT_CONNECTED  Connectedness = 1
    Connectedness_CONNECTEDNESS_CONNECTED      Connectedness = 2
    Connectedness_CONNECTEDNESS_CAN_CONNECT    Connectedness = 3
    Connectedness_CONNECTEDNESS_CANNOT_CONNECT Connectedness = 4
    Connectedness_CONNECTEDNESS_ERROR          Connectedness = 5
)

func (Connectedness) Descriptor Uses

func (Connectedness) Descriptor() protoreflect.EnumDescriptor

func (Connectedness) Enum Uses

func (x Connectedness) Enum() *Connectedness

func (Connectedness) EnumDescriptor Uses

func (Connectedness) EnumDescriptor() ([]byte, []int)

Deprecated: Use Connectedness.Descriptor instead.

func (Connectedness) Number Uses

func (x Connectedness) Number() protoreflect.EnumNumber

func (Connectedness) String Uses

func (x Connectedness) String() string

func (Connectedness) Type Uses

func (Connectedness) Type() protoreflect.EnumType

type ConnectednessRequest Uses

type ConnectednessRequest struct {
    PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
    // contains filtered or unexported fields
}

func (*ConnectednessRequest) Descriptor Uses

func (*ConnectednessRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConnectednessRequest.ProtoReflect.Descriptor instead.

func (*ConnectednessRequest) GetPeerId Uses

func (x *ConnectednessRequest) GetPeerId() string

func (*ConnectednessRequest) ProtoMessage Uses

func (*ConnectednessRequest) ProtoMessage()

func (*ConnectednessRequest) ProtoReflect Uses

func (x *ConnectednessRequest) ProtoReflect() protoreflect.Message

func (*ConnectednessRequest) Reset Uses

func (x *ConnectednessRequest) Reset()

func (*ConnectednessRequest) String Uses

func (x *ConnectednessRequest) String() string

type ConnectednessResponse Uses

type ConnectednessResponse struct {
    Connectedness Connectedness `protobuf:"varint,1,opt,name=connectedness,proto3,enum=net.rpc.Connectedness" json:"connectedness,omitempty"`
    // contains filtered or unexported fields
}

func (*ConnectednessResponse) Descriptor Uses

func (*ConnectednessResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConnectednessResponse.ProtoReflect.Descriptor instead.

func (*ConnectednessResponse) GetConnectedness Uses

func (x *ConnectednessResponse) GetConnectedness() Connectedness

func (*ConnectednessResponse) ProtoMessage Uses

func (*ConnectednessResponse) ProtoMessage()

func (*ConnectednessResponse) ProtoReflect Uses

func (x *ConnectednessResponse) ProtoReflect() protoreflect.Message

func (*ConnectednessResponse) Reset Uses

func (x *ConnectednessResponse) Reset()

func (*ConnectednessResponse) String Uses

func (x *ConnectednessResponse) String() string

type DisconnectPeerRequest Uses

type DisconnectPeerRequest struct {
    PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
    // contains filtered or unexported fields
}

func (*DisconnectPeerRequest) Descriptor Uses

func (*DisconnectPeerRequest) Descriptor() ([]byte, []int)

Deprecated: Use DisconnectPeerRequest.ProtoReflect.Descriptor instead.

func (*DisconnectPeerRequest) GetPeerId Uses

func (x *DisconnectPeerRequest) GetPeerId() string

func (*DisconnectPeerRequest) ProtoMessage Uses

func (*DisconnectPeerRequest) ProtoMessage()

func (*DisconnectPeerRequest) ProtoReflect Uses

func (x *DisconnectPeerRequest) ProtoReflect() protoreflect.Message

func (*DisconnectPeerRequest) Reset Uses

func (x *DisconnectPeerRequest) Reset()

func (*DisconnectPeerRequest) String Uses

func (x *DisconnectPeerRequest) String() string

type DisconnectPeerResponse Uses

type DisconnectPeerResponse struct {
    // contains filtered or unexported fields
}

func (*DisconnectPeerResponse) Descriptor Uses

func (*DisconnectPeerResponse) Descriptor() ([]byte, []int)

Deprecated: Use DisconnectPeerResponse.ProtoReflect.Descriptor instead.

func (*DisconnectPeerResponse) ProtoMessage Uses

func (*DisconnectPeerResponse) ProtoMessage()

func (*DisconnectPeerResponse) ProtoReflect Uses

func (x *DisconnectPeerResponse) ProtoReflect() protoreflect.Message

func (*DisconnectPeerResponse) Reset Uses

func (x *DisconnectPeerResponse) Reset()

func (*DisconnectPeerResponse) String Uses

func (x *DisconnectPeerResponse) String() string

type FindPeerRequest Uses

type FindPeerRequest struct {
    PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
    // contains filtered or unexported fields
}

func (*FindPeerRequest) Descriptor Uses

func (*FindPeerRequest) Descriptor() ([]byte, []int)

Deprecated: Use FindPeerRequest.ProtoReflect.Descriptor instead.

func (*FindPeerRequest) GetPeerId Uses

func (x *FindPeerRequest) GetPeerId() string

func (*FindPeerRequest) ProtoMessage Uses

func (*FindPeerRequest) ProtoMessage()

func (*FindPeerRequest) ProtoReflect Uses

func (x *FindPeerRequest) ProtoReflect() protoreflect.Message

func (*FindPeerRequest) Reset Uses

func (x *FindPeerRequest) Reset()

func (*FindPeerRequest) String Uses

func (x *FindPeerRequest) String() string

type FindPeerResponse Uses

type FindPeerResponse struct {
    PeerInfo *PeerInfo `protobuf:"bytes,1,opt,name=peer_info,json=peerInfo,proto3" json:"peer_info,omitempty"`
    // contains filtered or unexported fields
}

func (*FindPeerResponse) Descriptor Uses

func (*FindPeerResponse) Descriptor() ([]byte, []int)

Deprecated: Use FindPeerResponse.ProtoReflect.Descriptor instead.

func (*FindPeerResponse) GetPeerInfo Uses

func (x *FindPeerResponse) GetPeerInfo() *PeerInfo

func (*FindPeerResponse) ProtoMessage Uses

func (*FindPeerResponse) ProtoMessage()

func (*FindPeerResponse) ProtoReflect Uses

func (x *FindPeerResponse) ProtoReflect() protoreflect.Message

func (*FindPeerResponse) Reset Uses

func (x *FindPeerResponse) Reset()

func (*FindPeerResponse) String Uses

func (x *FindPeerResponse) String() string

type ListenAddrRequest Uses

type ListenAddrRequest struct {
    // contains filtered or unexported fields
}

func (*ListenAddrRequest) Descriptor Uses

func (*ListenAddrRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListenAddrRequest.ProtoReflect.Descriptor instead.

func (*ListenAddrRequest) ProtoMessage Uses

func (*ListenAddrRequest) ProtoMessage()

func (*ListenAddrRequest) ProtoReflect Uses

func (x *ListenAddrRequest) ProtoReflect() protoreflect.Message

func (*ListenAddrRequest) Reset Uses

func (x *ListenAddrRequest) Reset()

func (*ListenAddrRequest) String Uses

func (x *ListenAddrRequest) String() string

type ListenAddrResponse Uses

type ListenAddrResponse struct {
    AddrInfo *PeerAddrInfo `protobuf:"bytes,1,opt,name=addr_info,json=addrInfo,proto3" json:"addr_info,omitempty"`
    // contains filtered or unexported fields
}

func (*ListenAddrResponse) Descriptor Uses

func (*ListenAddrResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListenAddrResponse.ProtoReflect.Descriptor instead.

func (*ListenAddrResponse) GetAddrInfo Uses

func (x *ListenAddrResponse) GetAddrInfo() *PeerAddrInfo

func (*ListenAddrResponse) ProtoMessage Uses

func (*ListenAddrResponse) ProtoMessage()

func (*ListenAddrResponse) ProtoReflect Uses

func (x *ListenAddrResponse) ProtoReflect() protoreflect.Message

func (*ListenAddrResponse) Reset Uses

func (x *ListenAddrResponse) Reset()

func (*ListenAddrResponse) String Uses

func (x *ListenAddrResponse) String() string

type Location Uses

type Location struct {
    Country   string  `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"`
    Latitude  float64 `protobuf:"fixed64,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
    Longitude float64 `protobuf:"fixed64,3,opt,name=longitude,proto3" json:"longitude,omitempty"`
    // contains filtered or unexported fields
}

func (*Location) Descriptor Uses

func (*Location) Descriptor() ([]byte, []int)

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetCountry Uses

func (x *Location) GetCountry() string

func (*Location) GetLatitude Uses

func (x *Location) GetLatitude() float64

func (*Location) GetLongitude Uses

func (x *Location) GetLongitude() float64

func (*Location) ProtoMessage Uses

func (*Location) ProtoMessage()

func (*Location) ProtoReflect Uses

func (x *Location) ProtoReflect() protoreflect.Message

func (*Location) Reset Uses

func (x *Location) Reset()

func (*Location) String Uses

func (x *Location) String() string

type PeerAddrInfo Uses

type PeerAddrInfo struct {
    Id    string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
    Addrs []string `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"`
    // contains filtered or unexported fields
}

func (*PeerAddrInfo) Descriptor Uses

func (*PeerAddrInfo) Descriptor() ([]byte, []int)

Deprecated: Use PeerAddrInfo.ProtoReflect.Descriptor instead.

func (*PeerAddrInfo) GetAddrs Uses

func (x *PeerAddrInfo) GetAddrs() []string

func (*PeerAddrInfo) GetId Uses

func (x *PeerAddrInfo) GetId() string

func (*PeerAddrInfo) ProtoMessage Uses

func (*PeerAddrInfo) ProtoMessage()

func (*PeerAddrInfo) ProtoReflect Uses

func (x *PeerAddrInfo) ProtoReflect() protoreflect.Message

func (*PeerAddrInfo) Reset Uses

func (x *PeerAddrInfo) Reset()

func (*PeerAddrInfo) String Uses

func (x *PeerAddrInfo) String() string

type PeerInfo Uses

type PeerInfo struct {
    AddrInfo *PeerAddrInfo `protobuf:"bytes,1,opt,name=addr_info,json=addrInfo,proto3" json:"addr_info,omitempty"`
    Location *Location     `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
    // contains filtered or unexported fields
}

func (*PeerInfo) Descriptor Uses

func (*PeerInfo) Descriptor() ([]byte, []int)

Deprecated: Use PeerInfo.ProtoReflect.Descriptor instead.

func (*PeerInfo) GetAddrInfo Uses

func (x *PeerInfo) GetAddrInfo() *PeerAddrInfo

func (*PeerInfo) GetLocation Uses

func (x *PeerInfo) GetLocation() *Location

func (*PeerInfo) ProtoMessage Uses

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) ProtoReflect Uses

func (x *PeerInfo) ProtoReflect() protoreflect.Message

func (*PeerInfo) Reset Uses

func (x *PeerInfo) Reset()

func (*PeerInfo) String Uses

func (x *PeerInfo) String() string

type PeersRequest Uses

type PeersRequest struct {
    // contains filtered or unexported fields
}

func (*PeersRequest) Descriptor Uses

func (*PeersRequest) Descriptor() ([]byte, []int)

Deprecated: Use PeersRequest.ProtoReflect.Descriptor instead.

func (*PeersRequest) ProtoMessage Uses

func (*PeersRequest) ProtoMessage()

func (*PeersRequest) ProtoReflect Uses

func (x *PeersRequest) ProtoReflect() protoreflect.Message

func (*PeersRequest) Reset Uses

func (x *PeersRequest) Reset()

func (*PeersRequest) String Uses

func (x *PeersRequest) String() string

type PeersResponse Uses

type PeersResponse struct {
    Peers []*PeerInfo `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"`
    // contains filtered or unexported fields
}

func (*PeersResponse) Descriptor Uses

func (*PeersResponse) Descriptor() ([]byte, []int)

Deprecated: Use PeersResponse.ProtoReflect.Descriptor instead.

func (*PeersResponse) GetPeers Uses

func (x *PeersResponse) GetPeers() []*PeerInfo

func (*PeersResponse) ProtoMessage Uses

func (*PeersResponse) ProtoMessage()

func (*PeersResponse) ProtoReflect Uses

func (x *PeersResponse) ProtoReflect() protoreflect.Message

func (*PeersResponse) Reset Uses

func (x *PeersResponse) Reset()

func (*PeersResponse) String Uses

func (x *PeersResponse) String() string

type RPC Uses

type RPC struct {
    UnimplementedRPCServiceServer
    // contains filtered or unexported fields
}

RPC implements the rpc service.

func New Uses

func New(m net.Module) *RPC

New creates a new rpc service.

func (*RPC) ConnectPeer Uses

func (a *RPC) ConnectPeer(ctx context.Context, req *ConnectPeerRequest) (*ConnectPeerResponse, error)

ConnectPeer calls module.ConnectPeer.

func (*RPC) Connectedness Uses

func (a *RPC) Connectedness(ctx context.Context, req *ConnectednessRequest) (*ConnectednessResponse, error)

Connectedness calls module.Connectedness.

func (*RPC) DisconnectPeer Uses

func (a *RPC) DisconnectPeer(ctx context.Context, req *DisconnectPeerRequest) (*DisconnectPeerResponse, error)

DisconnectPeer calls module.DisconnectPeer.

func (*RPC) FindPeer Uses

func (a *RPC) FindPeer(ctx context.Context, req *FindPeerRequest) (*FindPeerResponse, error)

FindPeer calls module.FindPeer.

func (*RPC) ListenAddr Uses

func (a *RPC) ListenAddr(ctx context.Context, req *ListenAddrRequest) (*ListenAddrResponse, error)

ListenAddr calls module.ListenAddr.

func (*RPC) Peers Uses

func (a *RPC) Peers(ctx context.Context, req *PeersRequest) (*PeersResponse, error)

Peers calls module.Peers.

type RPCServiceClient Uses

type RPCServiceClient interface {
    ListenAddr(ctx context.Context, in *ListenAddrRequest, opts ...grpc.CallOption) (*ListenAddrResponse, error)
    Peers(ctx context.Context, in *PeersRequest, opts ...grpc.CallOption) (*PeersResponse, error)
    FindPeer(ctx context.Context, in *FindPeerRequest, opts ...grpc.CallOption) (*FindPeerResponse, error)
    ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error)
    DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error)
    Connectedness(ctx context.Context, in *ConnectednessRequest, opts ...grpc.CallOption) (*ConnectednessResponse, error)
}

RPCServiceClient is the client API for RPCService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRPCServiceClient Uses

func NewRPCServiceClient(cc grpc.ClientConnInterface) RPCServiceClient

type RPCServiceServer Uses

type RPCServiceServer interface {
    ListenAddr(context.Context, *ListenAddrRequest) (*ListenAddrResponse, error)
    Peers(context.Context, *PeersRequest) (*PeersResponse, error)
    FindPeer(context.Context, *FindPeerRequest) (*FindPeerResponse, error)
    ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error)
    DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error)
    Connectedness(context.Context, *ConnectednessRequest) (*ConnectednessResponse, error)
}

RPCServiceServer is the server API for RPCService service.

type UnimplementedRPCServiceServer Uses

type UnimplementedRPCServiceServer struct {
}

UnimplementedRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServiceServer) ConnectPeer Uses

func (*UnimplementedRPCServiceServer) ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error)

func (*UnimplementedRPCServiceServer) Connectedness Uses

func (*UnimplementedRPCServiceServer) Connectedness(context.Context, *ConnectednessRequest) (*ConnectednessResponse, error)

func (*UnimplementedRPCServiceServer) DisconnectPeer Uses

func (*UnimplementedRPCServiceServer) DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error)

func (*UnimplementedRPCServiceServer) FindPeer Uses

func (*UnimplementedRPCServiceServer) FindPeer(context.Context, *FindPeerRequest) (*FindPeerResponse, error)

func (*UnimplementedRPCServiceServer) ListenAddr Uses

func (*UnimplementedRPCServiceServer) ListenAddr(context.Context, *ListenAddrRequest) (*ListenAddrResponse, error)

func (*UnimplementedRPCServiceServer) Peers Uses

func (*UnimplementedRPCServiceServer) Peers(context.Context, *PeersRequest) (*PeersResponse, error)

Package rpc imports 12 packages (graph) and is imported by 6 packages. Updated 2020-09-21. Refresh now. Tools for package owners.