Documentation ¶
Index ¶
Constants ¶
View Source
const ( RecvCache int = 10000 SendCache int = 10000 )
View Source
const RequestsPollerTopic = "requests-poller"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct { ID string `json:"id" toml:"id"` Name string `json:"name" toml:"name"` Address net.TCPAddr `json:"address" toml:"address"` // contains filtered or unexported fields }
app
func New ¶
func New(config *config.Configuration, logger hclog.Logger) *Dispatcher
create a new dispatcher app
func (*Dispatcher) AwaitStop ¶
func (d *Dispatcher) AwaitStop() error
AwaitStop start the main program, blocking with sleep loop
func (*Dispatcher) NewNATSServer ¶
func (d *Dispatcher) NewNATSServer() (Transport, error)
type GRPCServer ¶
GRPCServer is the GRPC server for DNC Dispatcher. It handels all the requests comming down to the DNC
func (*GRPCServer) Ping ¶
func (rpc *GRPCServer) Ping(ctx context.Context, req *dispatcher.PingRequest) (*dispatcher.PingReply, error)
Ping implements the Ping Interface TODO not really needed, made for testing
type NATSServer ¶
type NATSServer struct { *nats.Conn // contains filtered or unexported fields }
func (*NATSServer) Close ¶
func (nats *NATSServer) Close() error
func (*NATSServer) Ping ¶
func (nats *NATSServer) Ping(ctx context.Context, req *dispatcher.PingRequest) (*dispatcher.PingReply, error)
type Transport ¶
type Transport interface { Put(ctx context.Context, request *transport.Message) (*transport.Message, error) Ping(ctx context.Context, request *dispatcher.PingRequest) (*dispatcher.PingReply, error) Close() error }
Transport is the interface that creates transportation between the dispatcher and the rest of the world. TODO request should be implemented through other means also: NATS, KAFKA, etc
Click to show internal directories.
Click to hide internal directories.