Add CloseConnectionRecording enums to the upstream message service

pull/3251/head
Todd 3 years ago committed by Timothy Messier
parent ba476ca73b
commit 68dc4da50e
No known key found for this signature in database
GPG Key ID: EFD2F184F7600572

@ -167,6 +167,8 @@ func toMsgType(ctx context.Context, m proto.Message) (pbs.MsgType, error) {
return pbs.MsgType_MSG_TYPE_UNWRAP_KEYS, nil
case *pbs.VerifySignatureRequest, *pbs.VerifySignatureResponse:
return pbs.MsgType_MSG_TYPE_VERIFY_SIGNATURE, nil
case *pbs.CloseConnectionRecordingRequest, *pbs.CloseConnectionRecordingResponse:
return pbs.MsgType_MSG_TYPE_CLOSE_CONNECTION, nil
default:
return pbs.MsgType_MSG_TYPE_UNSPECIFIED, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("%q is an unknown msg type", t))
}

@ -119,6 +119,8 @@ const (
// specific number of records returned a different count, e.g. if you
// expected to delete three items and only one was deleted.
UnexpectedRowsAffected Code = 1107
// ImmutableColumn is used when an operation attempted to mutate an immutable column.
ImmutableColumn Code = 1108
// Migration setup errors are codes 2000-2999
MigrationIntegrity Code = 2000 // MigrationIntegrity represents an error with the generated migration related code

@ -208,6 +208,9 @@ func Convert(e error) *Err {
case "23514": // check_violation
msg := fmt.Sprintf("%s constraint failed", pgxError.ConstraintName)
return E(ctx, WithoutEvent(), WithMsg(msg), WithWrap(E(ctx, WithoutEvent(), WithCode(CheckConstraint), WithMsg("check constraint violated")))).(*Err)
case "23602": // set_once_column
msg := fmt.Sprintf("%s.%s can only be set once", pgxError.TableName, pgxError.ColumnName)
return E(ctx, WithoutEvent(), WithMsg(msg), WithWrap(E(ctx, WithoutEvent(), WithCode(ImmutableColumn), WithMsg("set_once_column constraint violated")))).(*Err)
default:
return E(ctx, WithoutEvent(), WithCode(NotSpecificIntegrity), WithMsg(pgxError.Message)).(*Err)
}

@ -30,6 +30,7 @@ const (
MsgType_MSG_TYPE_ECHO MsgType = 1 // currently this only used for testing.
MsgType_MSG_TYPE_UNWRAP_KEYS MsgType = 2
MsgType_MSG_TYPE_VERIFY_SIGNATURE MsgType = 3
MsgType_MSG_TYPE_CLOSE_CONNECTION MsgType = 4
)
// Enum value maps for MsgType.
@ -39,12 +40,14 @@ var (
1: "MSG_TYPE_ECHO",
2: "MSG_TYPE_UNWRAP_KEYS",
3: "MSG_TYPE_VERIFY_SIGNATURE",
4: "MSG_TYPE_CLOSE_CONNECTION",
}
MsgType_value = map[string]int32{
"MSG_TYPE_UNSPECIFIED": 0,
"MSG_TYPE_ECHO": 1,
"MSG_TYPE_UNWRAP_KEYS": 2,
"MSG_TYPE_VERIFY_SIGNATURE": 3,
"MSG_TYPE_CLOSE_CONNECTION": 4,
}
)
@ -396,14 +399,16 @@ var file_controller_servers_services_v1_upstream_message_service_proto_rawDesc =
0x73, 0x67, 0x22, 0x2f, 0x0a, 0x1b, 0x45, 0x63, 0x68, 0x6f, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6d, 0x73, 0x67, 0x2a, 0x6f, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18,
0x0a, 0x14, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x53, 0x47, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x43, 0x48, 0x4f, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4d,
0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x57, 0x52, 0x41, 0x50, 0x5f, 0x4b,
0x45, 0x59, 0x53, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55,
0x52, 0x45, 0x10, 0x03, 0x32, 0x9f, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x73, 0x67, 0x2a, 0x8e, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12,
0x18, 0x0a, 0x14, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x53, 0x47,
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x43, 0x48, 0x4f, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14,
0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x57, 0x52, 0x41, 0x50, 0x5f,
0x4b, 0x45, 0x59, 0x53, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54,
0x55, 0x52, 0x45, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49,
0x4f, 0x4e, 0x10, 0x04, 0x32, 0x9f, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
0x84, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72,

@ -52,6 +52,7 @@ enum MsgType {
MSG_TYPE_ECHO = 1; // currently this only used for testing.
MSG_TYPE_UNWRAP_KEYS = 2;
MSG_TYPE_VERIFY_SIGNATURE = 3;
MSG_TYPE_CLOSE_CONNECTION = 4;
}
message EchoUpstreamMessageRequest {

Loading…
Cancel
Save