clientfactory

package
v0.0.0-...-2ef827d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 9 Imported by: 0

README

clientfactory

This package provides a factory for creating RPC clients.

Generate Mocks

To generate mocks run the Makefile target replacing the interface with whichever interface you want to mock:

make mockclient AGGREGATE=soccer VERSION=1

Default VERSION is 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConnection

func CloseConnection(logger l.Logger, connection *grpc.ClientConn)

CloseConnection will close the specified gRPC connection

Types

type ClientFactory

type ClientFactory interface {
	// CloseConnection will close the specified gRPC connection
	CloseConnection(logger l.Logger, connection *grpc.ClientConn)
	// CreatEventerClient creates a client connection to the EventStore RPC interface.
	// `defer CloseConnection(logger, conn)` will need to be called by the caller of this method.
	CreatEventerClient(logger l.Logger, url string) (espb.EventerClient, *grpc.ClientConn, error)
	// CreateRegistryClient creates a client connection to the Registry RPC interface.
	// `defer CloseConnection(logger, conn)` will need to be called by the caller of this method.
	CreateRegistryClient(logger l.Logger, url string) (rgpb.RegistryClient, *grpc.ClientConn, error)
	// TODO
	Create(logger l.Logger, desc grpc.ServiceDesc) *grpc.ClientConn
}

ClientFactory is a quick way to create connections to internal RPC clients

func NewClientFactory

func NewClientFactory() ClientFactory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL