Skip to content

Move Constants to RabbitMQ.Client #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions projects/Apigen/apigen/Apigen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,9 @@ internal sealed class Protocol : {ImplNamespaceBase}.ProtocolBase
///<summary>Default TCP port (= {port})</summary>
public override int DefaultPort => {port};
";
EmitLine(publicVars);
EmitMethodArgumentReader();
EmitLine("");
EmitContentHeaderReader();
EmitLine(" }");

EmitLine("namespace RabbitMQ.Client");
EmitLine("{");
EmitLine(" public static class Constants");
EmitLine(" {");
foreach (KeyValuePair<string, int> de in m_constants)
Expand All @@ -493,6 +491,12 @@ internal sealed class Protocol : {ImplNamespaceBase}.ProtocolBase
EmitLine($" public const int {MangleConstant(de.Key)} = {de.Value};");
}
EmitLine(" }");
EmitLine("}");
EmitLine(publicVars);
EmitMethodArgumentReader();
EmitLine("");
EmitContentHeaderReader();
EmitLine(" }");
foreach (AmqpClass c in m_classes)
{
EmitClassMethods(c);
Expand Down
57 changes: 27 additions & 30 deletions projects/Unit/APIApproval.Approve.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,33 @@ namespace RabbitMQ.Client
public ConnectionFactoryBase() { }
public static RabbitMQ.Client.ITcpClient DefaultSocketFactory(System.Net.Sockets.AddressFamily addressFamily) { }
}
public static class Constants
{
public const int AccessRefused = 403;
public const int ChannelError = 504;
public const int CommandInvalid = 503;
public const int ConnectionForced = 320;
public const int ContentTooLarge = 311;
public const int FrameBody = 3;
public const int FrameEnd = 206;
public const int FrameError = 501;
public const int FrameHeader = 2;
public const int FrameHeartbeat = 8;
public const int FrameMethod = 1;
public const int FrameMinSize = 4096;
public const int InternalError = 541;
public const int InvalidPath = 402;
public const int NoConsumers = 313;
public const int NotAllowed = 530;
public const int NotFound = 404;
public const int NotImplemented = 540;
public const int PreconditionFailed = 406;
public const int ReplySuccess = 200;
public const int ResourceError = 506;
public const int ResourceLocked = 405;
public const int SyntaxError = 502;
public const int UnexpectedFrame = 505;
}
public class DefaultBasicConsumer : RabbitMQ.Client.IBasicConsumer
{
public DefaultBasicConsumer() { }
Expand Down Expand Up @@ -782,36 +809,6 @@ namespace RabbitMQ.Client.Exceptions
public object Offender { get; }
}
}
namespace RabbitMQ.Client.Framing
{
public static class Constants
{
public const int AccessRefused = 403;
public const int ChannelError = 504;
public const int CommandInvalid = 503;
public const int ConnectionForced = 320;
public const int ContentTooLarge = 311;
public const int FrameBody = 3;
public const int FrameEnd = 206;
public const int FrameError = 501;
public const int FrameHeader = 2;
public const int FrameHeartbeat = 8;
public const int FrameMethod = 1;
public const int FrameMinSize = 4096;
public const int InternalError = 541;
public const int InvalidPath = 402;
public const int NoConsumers = 313;
public const int NotAllowed = 530;
public const int NotFound = 404;
public const int NotImplemented = 540;
public const int PreconditionFailed = 406;
public const int ReplySuccess = 200;
public const int ResourceError = 506;
public const int ResourceLocked = 405;
public const int SyntaxError = 502;
public const int UnexpectedFrame = 505;
}
}
namespace RabbitMQ.Client.Logging
{
[System.Diagnostics.Tracing.EventSource(Name="rabbitmq-dotnet-client")]
Expand Down