Documentation ¶
Overview ¶
Package api is a generated GoMock package.
Index ¶
- func ClientAuth(key *common.PrivateKey, genesis hash.Hash) grpc.UnaryClientInterceptor
- func GrpcPeerHost(ctx context.Context) string
- func GrpcPeerID(ctx context.Context) hash.Peer
- func IsProtoEmpty(m *proto.Message) bool
- func RegisterNodeServer(s *grpc.Server, srv NodeServer)
- func ServerAuth(key *common.PrivateKey, genesis hash.Hash) grpc.UnaryServerInterceptor
- func ServerPeerID(parent context.Context) (id *hash.Peer, ctx context.Context)
- func StartService(bind string, key *common.PrivateKey, genesis hash.Hash, svc NodeServer, ...) (*grpc.Server, string)
- type EventRequest
- func (*EventRequest) Descriptor() ([]byte, []int)
- func (m *EventRequest) GetHash() []byte
- func (m *EventRequest) GetIndex() uint64
- func (m *EventRequest) GetPeerID() string
- func (*EventRequest) ProtoMessage()
- func (m *EventRequest) Reset()
- func (m *EventRequest) String() string
- func (m *EventRequest) XXX_DiscardUnknown()
- func (m *EventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventRequest) XXX_Merge(src proto.Message)
- func (m *EventRequest) XXX_Size() int
- func (m *EventRequest) XXX_Unmarshal(b []byte) error
- type KnownEvents
- func (*KnownEvents) Descriptor() ([]byte, []int)
- func (m *KnownEvents) GetLasts() map[string]uint64
- func (*KnownEvents) ProtoMessage()
- func (m *KnownEvents) Reset()
- func (m *KnownEvents) String() string
- func (m *KnownEvents) XXX_DiscardUnknown()
- func (m *KnownEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *KnownEvents) XXX_Merge(src proto.Message)
- func (m *KnownEvents) XXX_Size() int
- func (m *KnownEvents) XXX_Unmarshal(b []byte) error
- type MockNodeClient
- func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder
- func (m *MockNodeClient) GetEvent(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*wire.Event, error)
- func (m *MockNodeClient) GetPeerInfo(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*PeerInfo, error)
- func (m *MockNodeClient) SyncEvents(ctx context.Context, in *KnownEvents, opts ...grpc.CallOption) (*KnownEvents, error)
- type MockNodeClientMockRecorder
- func (mr *MockNodeClientMockRecorder) GetEvent(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockNodeClientMockRecorder) GetPeerInfo(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockNodeClientMockRecorder) SyncEvents(ctx, in interface{}, opts ...interface{}) *gomock.Call
- type MockNodeServer
- func (m *MockNodeServer) EXPECT() *MockNodeServerMockRecorder
- func (m *MockNodeServer) GetEvent(arg0 context.Context, arg1 *EventRequest) (*wire.Event, error)
- func (m *MockNodeServer) GetPeerInfo(arg0 context.Context, arg1 *PeerRequest) (*PeerInfo, error)
- func (m *MockNodeServer) SyncEvents(arg0 context.Context, arg1 *KnownEvents) (*KnownEvents, error)
- type MockNodeServerMockRecorder
- type NodeClient
- type NodeServer
- type PeerIDs
- func (*PeerIDs) Descriptor() ([]byte, []int)
- func (m *PeerIDs) GetIDs() []string
- func (*PeerIDs) ProtoMessage()
- func (m *PeerIDs) Reset()
- func (m *PeerIDs) String() string
- func (m *PeerIDs) XXX_DiscardUnknown()
- func (m *PeerIDs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerIDs) XXX_Merge(src proto.Message)
- func (m *PeerIDs) XXX_Size() int
- func (m *PeerIDs) XXX_Unmarshal(b []byte) error
- type PeerInfo
- func (*PeerInfo) Descriptor() ([]byte, []int)
- func (m *PeerInfo) GetHost() string
- func (m *PeerInfo) GetID() string
- func (m *PeerInfo) GetPubKey() []byte
- func (*PeerInfo) ProtoMessage()
- func (m *PeerInfo) Reset()
- func (m *PeerInfo) String() string
- func (m *PeerInfo) XXX_DiscardUnknown()
- func (m *PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerInfo) XXX_Merge(src proto.Message)
- func (m *PeerInfo) XXX_Size() int
- func (m *PeerInfo) XXX_Unmarshal(b []byte) error
- type PeerRequest
- func (*PeerRequest) Descriptor() ([]byte, []int)
- func (m *PeerRequest) GetPeerID() string
- func (*PeerRequest) ProtoMessage()
- func (m *PeerRequest) Reset()
- func (m *PeerRequest) String() string
- func (m *PeerRequest) XXX_DiscardUnknown()
- func (m *PeerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerRequest) XXX_Merge(src proto.Message)
- func (m *PeerRequest) XXX_Size() int
- func (m *PeerRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientAuth ¶
func ClientAuth(key *common.PrivateKey, genesis hash.Hash) grpc.UnaryClientInterceptor
ClientAuth makes client-side interceptor for identification.
func GrpcPeerHost ¶
GrpcPeerHost extracts client's host from grpc context.
func GrpcPeerID ¶
GrpcPeerID extracts client's ID from grpc context.
func IsProtoEmpty ¶
IsProtoEmpty return true if it is typed nil (by protobuf sources).
func RegisterNodeServer ¶
func RegisterNodeServer(s *grpc.Server, srv NodeServer)
func ServerAuth ¶
func ServerAuth(key *common.PrivateKey, genesis hash.Hash) grpc.UnaryServerInterceptor
ServerAuth makes server-side interceptor for identification.
func ServerPeerID ¶
ServerPeerID makes context for gRPC call to get server-peer id.
func StartService ¶
func StartService(bind string, key *common.PrivateKey, genesis hash.Hash, svc NodeServer, log func(string, ...interface{}), listen network.ListenFunc) ( *grpc.Server, string)
StartService starts and returns gRPC server.
Types ¶
type EventRequest ¶
type EventRequest struct { PeerID string `protobuf:"bytes,1,opt,name=PeerID,proto3" json:"PeerID,omitempty"` Index uint64 `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"` Hash []byte `protobuf:"bytes,3,opt,name=Hash,proto3" json:"Hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EventRequest) Descriptor ¶
func (*EventRequest) Descriptor() ([]byte, []int)
func (*EventRequest) GetHash ¶
func (m *EventRequest) GetHash() []byte
func (*EventRequest) GetIndex ¶
func (m *EventRequest) GetIndex() uint64
func (*EventRequest) GetPeerID ¶
func (m *EventRequest) GetPeerID() string
func (*EventRequest) ProtoMessage ¶
func (*EventRequest) ProtoMessage()
func (*EventRequest) Reset ¶
func (m *EventRequest) Reset()
func (*EventRequest) String ¶
func (m *EventRequest) String() string
func (*EventRequest) XXX_DiscardUnknown ¶
func (m *EventRequest) XXX_DiscardUnknown()
func (*EventRequest) XXX_Marshal ¶
func (m *EventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventRequest) XXX_Merge ¶
func (m *EventRequest) XXX_Merge(src proto.Message)
func (*EventRequest) XXX_Size ¶
func (m *EventRequest) XXX_Size() int
func (*EventRequest) XXX_Unmarshal ¶
func (m *EventRequest) XXX_Unmarshal(b []byte) error
type KnownEvents ¶
type KnownEvents struct { Lasts map[string]uint64 `` /* 152-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*KnownEvents) Descriptor ¶
func (*KnownEvents) Descriptor() ([]byte, []int)
func (*KnownEvents) GetLasts ¶
func (m *KnownEvents) GetLasts() map[string]uint64
func (*KnownEvents) ProtoMessage ¶
func (*KnownEvents) ProtoMessage()
func (*KnownEvents) Reset ¶
func (m *KnownEvents) Reset()
func (*KnownEvents) String ¶
func (m *KnownEvents) String() string
func (*KnownEvents) XXX_DiscardUnknown ¶
func (m *KnownEvents) XXX_DiscardUnknown()
func (*KnownEvents) XXX_Marshal ¶
func (m *KnownEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*KnownEvents) XXX_Merge ¶
func (m *KnownEvents) XXX_Merge(src proto.Message)
func (*KnownEvents) XXX_Size ¶
func (m *KnownEvents) XXX_Size() int
func (*KnownEvents) XXX_Unmarshal ¶
func (m *KnownEvents) XXX_Unmarshal(b []byte) error
type MockNodeClient ¶
type MockNodeClient struct {
// contains filtered or unexported fields
}
MockNodeClient is a mock of NodeClient interface
func NewMockNodeClient ¶
func NewMockNodeClient(ctrl *gomock.Controller) *MockNodeClient
NewMockNodeClient creates a new mock instance
func (*MockNodeClient) EXPECT ¶
func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockNodeClient) GetEvent ¶
func (m *MockNodeClient) GetEvent(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*wire.Event, error)
GetEvent mocks base method
func (*MockNodeClient) GetPeerInfo ¶
func (m *MockNodeClient) GetPeerInfo(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*PeerInfo, error)
GetPeerInfo mocks base method
func (*MockNodeClient) SyncEvents ¶
func (m *MockNodeClient) SyncEvents(ctx context.Context, in *KnownEvents, opts ...grpc.CallOption) (*KnownEvents, error)
SyncEvents mocks base method
type MockNodeClientMockRecorder ¶
type MockNodeClientMockRecorder struct {
// contains filtered or unexported fields
}
MockNodeClientMockRecorder is the mock recorder for MockNodeClient
func (*MockNodeClientMockRecorder) GetEvent ¶
func (mr *MockNodeClientMockRecorder) GetEvent(ctx, in interface{}, opts ...interface{}) *gomock.Call
GetEvent indicates an expected call of GetEvent
func (*MockNodeClientMockRecorder) GetPeerInfo ¶
func (mr *MockNodeClientMockRecorder) GetPeerInfo(ctx, in interface{}, opts ...interface{}) *gomock.Call
GetPeerInfo indicates an expected call of GetPeerInfo
func (*MockNodeClientMockRecorder) SyncEvents ¶
func (mr *MockNodeClientMockRecorder) SyncEvents(ctx, in interface{}, opts ...interface{}) *gomock.Call
SyncEvents indicates an expected call of SyncEvents
type MockNodeServer ¶
type MockNodeServer struct {
// contains filtered or unexported fields
}
MockNodeServer is a mock of NodeServer interface
func NewMockNodeServer ¶
func NewMockNodeServer(ctrl *gomock.Controller) *MockNodeServer
NewMockNodeServer creates a new mock instance
func (*MockNodeServer) EXPECT ¶
func (m *MockNodeServer) EXPECT() *MockNodeServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockNodeServer) GetEvent ¶
func (m *MockNodeServer) GetEvent(arg0 context.Context, arg1 *EventRequest) (*wire.Event, error)
GetEvent mocks base method
func (*MockNodeServer) GetPeerInfo ¶
func (m *MockNodeServer) GetPeerInfo(arg0 context.Context, arg1 *PeerRequest) (*PeerInfo, error)
GetPeerInfo mocks base method
func (*MockNodeServer) SyncEvents ¶
func (m *MockNodeServer) SyncEvents(arg0 context.Context, arg1 *KnownEvents) (*KnownEvents, error)
SyncEvents mocks base method
type MockNodeServerMockRecorder ¶
type MockNodeServerMockRecorder struct {
// contains filtered or unexported fields
}
MockNodeServerMockRecorder is the mock recorder for MockNodeServer
func (*MockNodeServerMockRecorder) GetEvent ¶
func (mr *MockNodeServerMockRecorder) GetEvent(arg0, arg1 interface{}) *gomock.Call
GetEvent indicates an expected call of GetEvent
func (*MockNodeServerMockRecorder) GetPeerInfo ¶
func (mr *MockNodeServerMockRecorder) GetPeerInfo(arg0, arg1 interface{}) *gomock.Call
GetPeerInfo indicates an expected call of GetPeerInfo
func (*MockNodeServerMockRecorder) SyncEvents ¶
func (mr *MockNodeServerMockRecorder) SyncEvents(arg0, arg1 interface{}) *gomock.Call
SyncEvents indicates an expected call of SyncEvents
type NodeClient ¶
type NodeClient interface { SyncEvents(ctx context.Context, in *KnownEvents, opts ...grpc.CallOption) (*KnownEvents, error) GetEvent(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*wire.Event, error) GetPeerInfo(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*PeerInfo, error) }
NodeClient is the client API for Node service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewNodeClient ¶
func NewNodeClient(cc *grpc.ClientConn) NodeClient
type NodeServer ¶
type NodeServer interface { SyncEvents(context.Context, *KnownEvents) (*KnownEvents, error) GetEvent(context.Context, *EventRequest) (*wire.Event, error) GetPeerInfo(context.Context, *PeerRequest) (*PeerInfo, error) }
NodeServer is the server API for Node service.
type PeerIDs ¶
type PeerIDs struct { IDs []string `protobuf:"bytes,1,rep,name=IDs,proto3" json:"IDs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeerIDs) Descriptor ¶
func (*PeerIDs) ProtoMessage ¶
func (*PeerIDs) ProtoMessage()
func (*PeerIDs) XXX_DiscardUnknown ¶
func (m *PeerIDs) XXX_DiscardUnknown()
func (*PeerIDs) XXX_Marshal ¶
func (*PeerIDs) XXX_Unmarshal ¶
type PeerInfo ¶
type PeerInfo struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` PubKey []byte `protobuf:"bytes,2,opt,name=PubKey,proto3" json:"PubKey,omitempty"` Host string `protobuf:"bytes,3,opt,name=Host,proto3" json:"Host,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeerInfo) Descriptor ¶
func (*PeerInfo) ProtoMessage ¶
func (*PeerInfo) ProtoMessage()
func (*PeerInfo) XXX_DiscardUnknown ¶
func (m *PeerInfo) XXX_DiscardUnknown()
func (*PeerInfo) XXX_Marshal ¶
func (*PeerInfo) XXX_Unmarshal ¶
type PeerRequest ¶
type PeerRequest struct { PeerID string `protobuf:"bytes,1,opt,name=PeerID,proto3" json:"PeerID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeerRequest) Descriptor ¶
func (*PeerRequest) Descriptor() ([]byte, []int)
func (*PeerRequest) GetPeerID ¶
func (m *PeerRequest) GetPeerID() string
func (*PeerRequest) ProtoMessage ¶
func (*PeerRequest) ProtoMessage()
func (*PeerRequest) Reset ¶
func (m *PeerRequest) Reset()
func (*PeerRequest) String ¶
func (m *PeerRequest) String() string
func (*PeerRequest) XXX_DiscardUnknown ¶
func (m *PeerRequest) XXX_DiscardUnknown()
func (*PeerRequest) XXX_Marshal ¶
func (m *PeerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PeerRequest) XXX_Merge ¶
func (m *PeerRequest) XXX_Merge(src proto.Message)
func (*PeerRequest) XXX_Size ¶
func (m *PeerRequest) XXX_Size() int
func (*PeerRequest) XXX_Unmarshal ¶
func (m *PeerRequest) XXX_Unmarshal(b []byte) error