-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a718fcd
commit bf6a199
Showing
17 changed files
with
624 additions
and
159 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use bytes::{Buf, BufMut}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::codec::{decode_default, encode_default, Targeted, WireDecode, WireEncode}; | ||
use crate::common::{ProtocolVersion, RequestId, TargetName}; | ||
use crate::CodecError; | ||
|
||
#[derive( | ||
Debug, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
derive_more::From, | ||
strum_macros::EnumIs, | ||
strum_macros::IntoStaticStr, | ||
)] | ||
pub enum ClusterControllerMessage { | ||
Attach(AttachementDetails), | ||
} | ||
|
||
impl Targeted for ClusterControllerMessage { | ||
const TARGET: TargetName = TargetName::ClusterController; | ||
|
||
fn kind(&self) -> &'static str { | ||
self.into() | ||
} | ||
} | ||
|
||
impl WireEncode for ClusterControllerMessage { | ||
fn encode<B: BufMut>( | ||
&self, | ||
buf: &mut B, | ||
protocol_version: ProtocolVersion, | ||
) -> Result<(), CodecError> { | ||
// serialize message into buf | ||
encode_default(self, buf, protocol_version) | ||
} | ||
} | ||
|
||
impl WireDecode for ClusterControllerMessage { | ||
fn decode<B: Buf>(buf: &mut B, protocol_version: ProtocolVersion) -> Result<Self, CodecError> | ||
where | ||
Self: Sized, | ||
{ | ||
decode_default(buf, protocol_version) | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct AttachementDetails { | ||
pub request_id: RequestId, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.