feat(policy): Use int32 to avoid json converting int64->float64 string

This commit is contained in:
Louis Ruch committed 2024-01-16 13:53:44 -08:00
1 parent 360dd616ff
commit 853ce5dcd6
4 files changed
+48 -53

No files matched your search

+6 -6
View File
@@ -42,14 +42,14 @@ type Policy struct {
// retain_for_days is the number of days for which a session recording will be
// retained. Must be provided.
// @inject_tag: `gorm:"not_null"`
RetainForDays int64 `protobuf:"varint,3,opt,name=retain_for_days,json=retainForDays,proto3" json:"retain_for_days,omitempty" gorm:"not_null"`
RetainForDays int32 `protobuf:"varint,3,opt,name=retain_for_days,json=retainForDays,proto3" json:"retain_for_days,omitempty" gorm:"not_null"`
// retain_for_days_overridable signals whether this storage policy's retention
// duration can be overridden.
RetainForDaysOverridable bool `protobuf:"varint,4,opt,name=retain_for_days_overridable,json=retainForDaysOverridable,proto3" json:"retain_for_days_overridable,omitempty"`
// delete_after_days is the number of days after which a session recording
// will be automatically deleted.
// @inject_tag: `gorm:"not_null"`
DeleteAfterDays int64 `protobuf:"varint,5,opt,name=delete_after_days,json=deleteAfterDays,proto3" json:"delete_after_days,omitempty" gorm:"not_null"`
DeleteAfterDays int32 `protobuf:"varint,5,opt,name=delete_after_days,json=deleteAfterDays,proto3" json:"delete_after_days,omitempty" gorm:"not_null"`
// delete_after_days_overridable signals whether this storage policy's
// deletion policy can be overridden.
DeleteAfterDaysOverridable bool `protobuf:"varint,6,opt,name=delete_after_days_overridable,json=deleteAfterDaysOverridable,proto3" json:"delete_after_days_overridable,omitempty"`
@@ -116,7 +116,7 @@ func (x *Policy) GetScopeId() string {
return ""
}
func (x *Policy) GetRetainForDays() int64 {
func (x *Policy) GetRetainForDays() int32 {
if x != nil {
return x.RetainForDays
}
@@ -130,7 +130,7 @@ func (x *Policy) GetRetainForDaysOverridable() bool {
return false
}
func (x *Policy) GetDeleteAfterDays() int64 {
func (x *Policy) GetDeleteAfterDays() int32 {
if x != nil {
return x.DeleteAfterDays
}
@@ -199,7 +199,7 @@ var file_controller_storage_policy_storage_store_v1_policy_proto_rawDesc = []byt
0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63,
0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63,
0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x57, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f,
0x66, 0x6f, 0x72, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x2f,
0x66, 0x6f, 0x72, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x2f,
0xc2, 0xdd, 0x29, 0x2b, 0x0a, 0x0d, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x44,
0x61, 0x79, 0x73, 0x12, 0x1a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e,
0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x64, 0x61, 0x79, 0x73, 0x52,
@@ -213,7 +213,7 @@ var file_controller_storage_policy_storage_store_v1_policy_proto_rawDesc = []byt
0x72, 0x69, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x18, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x46,
0x6f, 0x72, 0x44, 0x61, 0x79, 0x73, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, 0x62, 0x6c,
0x65, 0x12, 0x5f, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x61, 0x66, 0x74, 0x65,
0x72, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x33, 0xc2, 0xdd,
0x72, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x33, 0xc2, 0xdd,
0x29, 0x2f, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44,
0x61, 0x79, 0x73, 0x12, 0x1c, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e,
0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x2e, 0x64, 0x61, 0x79,