Documentation ¶
Overview ¶
Package interconnect contains logic for cross communication between the cMix servers and xxNetwork's consensus
Index ¶
- Variables
- func RegisterInterconnectServer(s grpc.ServiceRegistrar, srv InterconnectServer)
- type CMixClient
- type CMixServer
- type ClientHandler
- type Implementation
- type InterconnectClient
- type InterconnectServer
- type NDF
- type ServerHandler
- type UnimplementedInterconnectServer
- type UnsafeInterconnectServer
Constants ¶
This section is empty.
Variables ¶
var File_interconnect_proto protoreflect.FileDescriptor
var Interconnect_ServiceDesc = grpc.ServiceDesc{ ServiceName: "interconnect.Interconnect", HandlerType: (*InterconnectServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetNDF", Handler: _Interconnect_GetNDF_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "interconnect.proto", }
Interconnect_ServiceDesc is the grpc.ServiceDesc for Interconnect service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterInterconnectServer ¶
func RegisterInterconnectServer(s grpc.ServiceRegistrar, srv InterconnectServer)
Types ¶
type CMixClient ¶
type CMixClient struct { *connect.ProtoComms // contains filtered or unexported fields }
CMixServer object used to implement endpoints and top-level comms functionality
type CMixServer ¶
type CMixServer struct { *connect.ProtoComms *UnimplementedInterconnectServer // contains filtered or unexported fields }
CMixServer object used to implement endpoints and top-level comms functionality
func StartCMixInterconnect ¶
func StartCMixInterconnect(id *id.ID, port string, handler ServerHandler, certPEMblock, keyPEMblock []byte) (*CMixServer, closeListener)
Starts a new server on the localHost:port specified by port and a callback interface for interconnect operations with given path to public and private key for TLS connection
type Implementation ¶
type Implementation struct {
Functions implementationFunctions
}
Implementation allows users of the client library to set the functions that implement the node functions
func NewImplementation ¶
func NewImplementation() *Implementation
NewImplementation returns a Implementation struct with all of the function pointers returning nothing and printing an error.
func (*Implementation) GetNDF ¶
func (s *Implementation) GetNDF() (*NDF, error)
Interconnect Interface for getting an NDF
type InterconnectClient ¶
type InterconnectClient interface {
GetNDF(ctx context.Context, in *messages.Ping, opts ...grpc.CallOption) (*NDF, error)
}
InterconnectClient is the client API for Interconnect service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewInterconnectClient ¶
func NewInterconnectClient(cc grpc.ClientConnInterface) InterconnectClient
type InterconnectServer ¶
type InterconnectServer interface { GetNDF(context.Context, *messages.Ping) (*NDF, error) // contains filtered or unexported methods }
InterconnectServer is the server API for Interconnect service. All implementations must embed UnimplementedInterconnectServer for forward compatibility
type NDF ¶
type NDF struct { Ndf []byte `protobuf:"bytes,1,opt,name=Ndf,proto3" json:"Ndf,omitempty"` // contains filtered or unexported fields }
The Network Definition File is defined as a JSON structure in primitives/ndf.
func (*NDF) Descriptor
deprecated
func (*NDF) ProtoMessage ¶
func (*NDF) ProtoMessage()
func (*NDF) ProtoReflect ¶
func (x *NDF) ProtoReflect() protoreflect.Message
type ServerHandler ¶
type ServerHandler interface { // Interconnect interface for getting the NDF GetNDF() (*NDF, error) }
Handler for CMix -> consensus
type UnimplementedInterconnectServer ¶
type UnimplementedInterconnectServer struct { }
UnimplementedInterconnectServer must be embedded to have forward compatible implementations.
type UnsafeInterconnectServer ¶
type UnsafeInterconnectServer interface {
// contains filtered or unexported methods
}
UnsafeInterconnectServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InterconnectServer will result in compilation errors.