This commit is contained in:
Stephan D
2026-03-10 12:31:09 +01:00
parent d87e709f43
commit e77d1ab793
287 changed files with 2089 additions and 1550 deletions

View File

@@ -37,7 +37,7 @@ func (i *Imp) initDiscovery(cfg *config) {
InvokeURI: cfg.GRPC.DiscoveryInvokeURI(),
Version: appversion.Create().Short(),
}
i.discoveryAnnouncer = discovery.NewAnnouncer(i.logger, producer, string(mservice.PaymentOrchestrator), announce)
i.discoveryAnnouncer = discovery.NewAnnouncer(i.logger, producer, mservice.PaymentOrchestrator, announce)
i.discoveryAnnouncer.Start()
}

View File

@@ -321,7 +321,7 @@ func (r *discoveryClientResolver) findEntry(service mservice.Type, rail string,
}
func discoverySelectionKey(service mservice.Type, rail, network string) string {
serviceName := strings.TrimSpace(string(service))
serviceName := strings.TrimSpace(service)
railName := strings.ToUpper(strings.TrimSpace(rail))
networkName := strings.ToUpper(strings.TrimSpace(network))
@@ -392,10 +392,10 @@ func discoveryEntryKey(entry discovery.RegistryEntry) string {
func matchesService(service string, candidate mservice.Type) bool {
service = strings.TrimSpace(service)
if service == "" || strings.TrimSpace(string(candidate)) == "" {
if service == "" || strings.TrimSpace(candidate) == "" {
return false
}
return strings.EqualFold(service, strings.TrimSpace(string(candidate)))
return strings.EqualFold(service, strings.TrimSpace(candidate))
}
func parseDiscoveryEndpoint(raw string) (discoveryEndpoint, error) {
@@ -441,15 +441,12 @@ func parseDiscoveryEndpoint(raw string) (discoveryEndpoint, error) {
}
}
func dialGrpc(ctx context.Context, endpoint discoveryEndpoint) (*grpc.ClientConn, error) {
func dialGrpc(_ context.Context, endpoint discoveryEndpoint) (*grpc.ClientConn, error) {
dialOpts := []grpc.DialOption{}
if endpoint.insecure {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(nil)))
}
if ctx == nil {
ctx = context.Background()
}
return grpc.NewClient(endpoint.address, dialOpts...)
}

View File

@@ -203,7 +203,7 @@ func (c *discoveryLedgerClient) Close() error {
}
client, err := c.resolver.LedgerClient(context.Background())
if err != nil {
return nil
return err
}
return client.Close()
}
@@ -241,7 +241,7 @@ func (c *discoveryOracleClient) Close() error {
}
client, err := c.resolver.OracleClient(context.Background())
if err != nil {
return nil
return err
}
return client.Close()
}
@@ -348,7 +348,7 @@ func (c *discoveryChainClient) Close() error {
}
client, err := c.resolver.ChainClient(context.Background(), c.invokeURI)
if err != nil {
return nil
return err
}
return client.Close()
}