-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate enums for Gateway condition types and reasons
Add a xtask to generate enums for Condition types and reasons along with an implemention of the Display trait for easy stringification. Use xtask for Gateway Condition types and reasons: `GatewayConditionType`, `GatewayConditionReason`, `ListenerConditionType`, `ListenerConditionReason`. Signed-off-by: Sanskar Jaiswal <[email protected]>
- Loading branch information
Showing
6 changed files
with
218 additions
and
2 deletions.
There are no files selected for viewing
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,74 @@ | ||
// WARNING: generated file - manual changes will be overriden | ||
|
||
#[derive(Debug)] | ||
enum GatewayConditionType { | ||
Programmed, | ||
Accepted, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for GatewayConditionType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum GatewayConditionReason { | ||
Programmed, | ||
Invalid, | ||
NoResources, | ||
AddressNotAssigned, | ||
AddressNotUsable, | ||
Accepted, | ||
ListenersNotValid, | ||
Pending, | ||
UnsupportedAddress, | ||
InvalidParameters, | ||
Ready, | ||
ListenersNotReady, | ||
} | ||
|
||
impl std::fmt::Display for GatewayConditionReason { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum ListenerConditionType { | ||
Conflicted, | ||
Accepted, | ||
ResolvedRefs, | ||
Programmed, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for ListenerConditionType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum ListenerConditionReason { | ||
HostnameConflict, | ||
ProtocolConflict, | ||
NoConflicts, | ||
Accepted, | ||
PortUnavailable, | ||
UnsupportedProtocol, | ||
InvalidCertificateRef, | ||
InvalidRouteKinds, | ||
RefNotPermitted, | ||
Programmed, | ||
Invalid, | ||
Pending, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for ListenerConditionReason { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} |
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,74 @@ | ||
// WARNING: generated file - manual changes will be overriden | ||
|
||
#[derive(Debug)] | ||
enum GatewayConditionType { | ||
Programmed, | ||
Accepted, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for GatewayConditionType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum GatewayConditionReason { | ||
Programmed, | ||
Invalid, | ||
NoResources, | ||
AddressNotAssigned, | ||
AddressNotUsable, | ||
Accepted, | ||
ListenersNotValid, | ||
Pending, | ||
UnsupportedAddress, | ||
InvalidParameters, | ||
Ready, | ||
ListenersNotReady, | ||
} | ||
|
||
impl std::fmt::Display for GatewayConditionReason { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum ListenerConditionType { | ||
Conflicted, | ||
Accepted, | ||
ResolvedRefs, | ||
Programmed, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for ListenerConditionType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
enum ListenerConditionReason { | ||
HostnameConflict, | ||
ProtocolConflict, | ||
NoConflicts, | ||
Accepted, | ||
PortUnavailable, | ||
UnsupportedProtocol, | ||
InvalidCertificateRef, | ||
InvalidRouteKinds, | ||
RefNotPermitted, | ||
Programmed, | ||
Invalid, | ||
Pending, | ||
Ready, | ||
} | ||
|
||
impl std::fmt::Display for ListenerConditionReason { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(f, "{:?}", self) | ||
} | ||
} |
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