feat: fai_dart_sdk scaffold
Dart package skeleton for the F∆I gRPC client. Used by F∆I Studio (Tier-2) and Tier-3 domain apps (DigiScout / J∆I / Scout). Public surface — HubClient, HubEndpoint — is committed as a typed stub so downstream apps can compile against it immediately. Generated proto bindings land in a follow-up commit once the codegen step (planned: tools/generate.sh wrapping protoc-gen-dart against ../fai_platform/proto) is wired in. Future Forgejo path: fai/dart-sdk. dart analyze: clean. dart test: 4/4. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
commit
d405a6a9bd
9 changed files with 216 additions and 0 deletions
43
lib/src/hub_client.dart
Normal file
43
lib/src/hub_client.dart
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// HubClient — typed wrapper around the F∆I Hub gRPC service.
|
||||
//
|
||||
// Status (2026-05-05): scaffold. The generated proto bindings
|
||||
// from `fai/platform`'s proto/fai/v1/ directory will populate
|
||||
// the actual RPC implementations under `lib/src/generated/`
|
||||
// once the codegen tooling is wired (planned: a small
|
||||
// `tools/generate.sh` script that runs `protoc` with
|
||||
// `protoc-gen-dart` against the platform repo's protos).
|
||||
|
||||
/// Connection coordinates for a hub endpoint.
|
||||
class HubEndpoint {
|
||||
/// Hostname or IP. Defaults to localhost for the canonical
|
||||
/// `fai serve` setup.
|
||||
final String host;
|
||||
|
||||
/// gRPC port. Defaults to 50051.
|
||||
final int port;
|
||||
|
||||
/// When true, use TLS. Phase 1+ will add credential support.
|
||||
final bool secure;
|
||||
|
||||
const HubEndpoint({
|
||||
this.host = '127.0.0.1',
|
||||
this.port = 50051,
|
||||
this.secure = false,
|
||||
});
|
||||
|
||||
@override
|
||||
String toString() => '${secure ? "https" : "http"}://$host:$port';
|
||||
}
|
||||
|
||||
/// Stub client interface. The real implementation will arrive
|
||||
/// when proto codegen is wired in. Studio uses this type as the
|
||||
/// future-stable surface; the mock data layer in
|
||||
/// `fai_studio/lib/data/mock.dart` is the placeholder until then.
|
||||
class HubClient {
|
||||
final HubEndpoint endpoint;
|
||||
|
||||
HubClient({this.endpoint = const HubEndpoint()});
|
||||
|
||||
/// Closes the underlying channel. No-op while stubbed.
|
||||
Future<void> close() async {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue