Documentation
¶
Overview ¶
Copyright (c) 2021-2023 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport interface { Run(func()) error Stop() GetIn() chan *pb.Event GetOut() chan *pb.Event Events(stream pb.Discovery_EventsServer) error }
Transport is in interface covering the discovery service transport.
type TransportConfig ¶
type TransportConfig struct {
// In, Out is the external interface for the libraries that would like to use this client. Events received from "In" are forwarded to the server. The responses are sent back to "Out"
In, Out chan *pb.Event
// ErrCh is the sink for all errors from the client.
ErrCh chan error
// Port - the port to open up the connection.
Port string
Logger *zap.SugaredLogger
}
TransportConfig is configuration of the GRPC Server.
type TransportServer ¶
type TransportServer struct {
// contains filtered or unexported fields
}
TransportServer is a server the dispatches messsages from and to GRPC based transport.
func NewTransportServer ¶
func NewTransportServer(conf *TransportConfig) *TransportServer
NewTransportServer returns a new transport server.
func (*TransportServer) Events ¶
func (d *TransportServer) Events(stream pb.Discovery_EventsServer) error
Events is a Remote Procedure that is executed by GRPC clients. it instantiates the communication with the server. The messages are sent and read from In and Out channels instead of manipulating the GRPC stream directly.
func (*TransportServer) GetIn ¶
func (d *TransportServer) GetIn() chan *pb.Event
GetIn returns the input channel of the transport.
func (*TransportServer) GetOut ¶
func (d *TransportServer) GetOut() chan *pb.Event
GetOut returns the output channel of the transport.
func (*TransportServer) Run ¶
func (d *TransportServer) Run(cb func()) error
Run starts the transport server.