实现gzip

This commit is contained in:
GoEdgeLab
2020-09-29 17:23:11 +08:00
parent 3af4c6052c
commit aa0ca23211
16 changed files with 375 additions and 358 deletions

View File

@@ -30,12 +30,12 @@ type HTTPGzip struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"`
MinLength *SizeCapacity `protobuf:"bytes,4,opt,name=minLength,proto3" json:"minLength,omitempty"`
MaxLength *SizeCapacity `protobuf:"bytes,5,opt,name=maxLength,proto3" json:"maxLength,omitempty"`
CondGroupsJSON []byte `protobuf:"bytes,6,opt,name=CondGroupsJSON,proto3" json:"CondGroupsJSON,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"`
MinLength *SizeCapacity `protobuf:"bytes,4,opt,name=minLength,proto3" json:"minLength,omitempty"`
MaxLength *SizeCapacity `protobuf:"bytes,5,opt,name=maxLength,proto3" json:"maxLength,omitempty"`
CondsJSON []byte `protobuf:"bytes,6,opt,name=condsJSON,proto3" json:"condsJSON,omitempty"`
}
func (x *HTTPGzip) Reset() {
@@ -105,9 +105,9 @@ func (x *HTTPGzip) GetMaxLength() *SizeCapacity {
return nil
}
func (x *HTTPGzip) GetCondGroupsJSON() []byte {
func (x *HTTPGzip) GetCondsJSON() []byte {
if x != nil {
return x.CondGroupsJSON
return x.CondsJSON
}
return nil
}
@@ -118,7 +118,7 @@ var file_model_http_gzip_proto_rawDesc = []byte{
0x0a, 0x15, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x67, 0x7a, 0x69,
0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x08, 0x48, 0x54, 0x54, 0x50, 0x47,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x01, 0x0a, 0x08, 0x48, 0x54, 0x54, 0x50, 0x47,
0x7a, 0x69, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
@@ -128,11 +128,10 @@ var file_model_http_gzip_proto_rawDesc = []byte{
0x74, 0x79, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2e, 0x0a,
0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69,
0x74, 0x79, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x26, 0x0a,
0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18,
0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x79, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x0a,
0x09, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (