Documentation
¶
Index ¶
- type Config
- type DeDiRegistryClient
- func (c *DeDiRegistryClient) Lookup(ctx context.Context, req *model.Subscription) ([]model.Subscription, error)
- func (c *DeDiRegistryClient) LookupNode(ctx context.Context, nodeID string) (*model.SubscriberRecord, error)
- func (c *DeDiRegistryClient) LookupRegistry(ctx context.Context, namespaceIdentifier, registryName string) (*model.RegistryMetadata, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
URL string `yaml:"url" json:"url"`
CacheTTL time.Duration `yaml:"cacheTTL" json:"cacheTTL"`
AllowedNetworkIDs []string `yaml:"allowedNetworkIDs" json:"allowedNetworkIDs"`
Timeout int `yaml:"timeout" json:"timeout"`
RetryMax int `yaml:"retry_max" json:"retry_max"`
RetryWaitMin time.Duration `yaml:"retry_wait_min" json:"retry_wait_min"`
RetryWaitMax time.Duration `yaml:"retry_wait_max" json:"retry_wait_max"`
}
Config holds configuration parameters for the DeDi registry client.
type DeDiRegistryClient ¶
type DeDiRegistryClient struct {
// contains filtered or unexported fields
}
DeDiRegistryClient encapsulates the logic for calling the DeDi registry endpoints.
func New ¶
func New(ctx context.Context, cache definition.Cache, cfg *Config) (*DeDiRegistryClient, func() error, error)
New creates a new instance of DeDiRegistryClient.
func (*DeDiRegistryClient) Lookup ¶
func (c *DeDiRegistryClient) Lookup(ctx context.Context, req *model.Subscription) ([]model.Subscription, error)
Lookup implements RegistryLookup interface — calls the DeDi wrapper lookup endpoint and returns Subscription. Results are cached using the subscriber ID and key ID as the cache key. On a cache hit the network call is skipped entirely.
func (*DeDiRegistryClient) LookupNode ¶ added in v1.8.0
func (c *DeDiRegistryClient) LookupNode(ctx context.Context, nodeID string) (*model.SubscriberRecord, error)
LookupNode looks up a subscriber record by its fully-qualified NodeID. nodeID must be in namespace/registry/recordName format (exactly 3 non-empty parts separated by "/"). Returns a SubscriberRecord with both subscriber details (URL, keys) and node manifest metadata from the same DeDi response. Meta is empty (not an error) when the participant has not yet published a node manifest. AllowedNetworkIDs is not applied — node record reads are not trust decisions and should not be gated by network membership.
func (*DeDiRegistryClient) LookupRegistry ¶ added in v1.6.0
func (c *DeDiRegistryClient) LookupRegistry(ctx context.Context, namespaceIdentifier, registryName string) (*model.RegistryMetadata, error)
LookupRegistry fetches registry-level metadata for the given DeDi registry path.