appendFeedEntry static method
Append an entry to a feed
Implementation
static Future<FeedFrameResponse> appendFeedEntry(
P2PStream stream, {
required PeerId ownerPeerId,
required String path,
required Uint8List content,
String? entryType,
}) async {
try {
final requestBytes = FeedFrame.encodeRequest(
operation: 'APPEND',
ownerPeerId: ownerPeerId,
path: path,
body: content,
entryType: entryType,
);
await _writeFrameStatic(stream, requestBytes);
final responseBytes = await _readFrameStatic(stream);
return FeedFrame.decodeResponse(responseBytes);
} catch (e, stackTrace) {
_logger.severe('Error appending feed entry: $e', e, stackTrace);
rethrow;
}
}