dubbo-rs-metadata
Metadata center for application-level service discovery in dubbo-rs.
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Or use cargo add:
Provides data structures for describing Dubbo services and a storage abstraction for metadata management. Supports JSON serialization via serde.
Key Types
| Type | Description |
|---|---|
MetadataInfo |
Application metadata — application, revision, services, attributes |
ServiceDefinition |
Per-service metadata — interface, version, group, methods, params |
MethodDefinition |
Per-method metadata — name, parameter_types, return_type, stream_type, oneway |
StreamType |
Enum: Unary (default), ClientStreaming, ServerStreaming, BidiStreaming |
MetadataStorage |
Trait: store, get, remove, applications |
InMemoryMetadataStorage |
Concurrent in-memory storage backed by DashMap |
MetadataService |
Async trait: get_metadata_info, get_service_definition, get_exported_service_urls, echo |
DefaultMetadataService |
Concrete MetadataService backed by MetadataStorage |
Usage
use Arc;
use *;
// Define services with builder pattern
let service = new
.with_version
.with_group
.with_method
.with_method;
// Build application metadata
let metadata = new
.with_revision
.with_service;
// Store in memory
let storage = new;
storage.store;
// Query via MetadataService
let service = new;
let info = service.get_metadata_info.await;
let urls = service.get_exported_service_urls.await;
// JSON serialization
let json = to_string.unwrap;
License
Apache-2.0