增加字符编码/HTTP Header管理

This commit is contained in:
GoEdgeLab
2020-09-16 20:29:26 +08:00
parent 1648192e73
commit afec1c1fe7
22 changed files with 3275 additions and 135 deletions

View File

@@ -30,10 +30,13 @@ type HTTPWeb 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"`
Root string `protobuf:"bytes,3,opt,name=root,proto3" json:"root,omitempty"`
GzipId int64 `protobuf:"varint,4,opt,name=gzipId,proto3" json:"gzipId,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"`
Root string `protobuf:"bytes,3,opt,name=root,proto3" json:"root,omitempty"`
GzipId int64 `protobuf:"varint,4,opt,name=gzipId,proto3" json:"gzipId,omitempty"`
Charset string `protobuf:"bytes,5,opt,name=charset,proto3" json:"charset,omitempty"`
RequestHeaderPolicyId int64 `protobuf:"varint,6,opt,name=requestHeaderPolicyId,proto3" json:"requestHeaderPolicyId,omitempty"`
ResponseHeaderPolicyId int64 `protobuf:"varint,7,opt,name=responseHeaderPolicyId,proto3" json:"responseHeaderPolicyId,omitempty"`
}
func (x *HTTPWeb) Reset() {
@@ -96,18 +99,47 @@ func (x *HTTPWeb) GetGzipId() int64 {
return 0
}
func (x *HTTPWeb) GetCharset() string {
if x != nil {
return x.Charset
}
return ""
}
func (x *HTTPWeb) GetRequestHeaderPolicyId() int64 {
if x != nil {
return x.RequestHeaderPolicyId
}
return 0
}
func (x *HTTPWeb) GetResponseHeaderPolicyId() int64 {
if x != nil {
return x.ResponseHeaderPolicyId
}
return 0
}
var File_model_http_web_proto protoreflect.FileDescriptor
var file_model_http_web_proto_rawDesc = []byte{
0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x77, 0x65, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x59, 0x0a, 0x07, 0x48, 0x54,
0x54, 0x50, 0x57, 0x65, 0x62, 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, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x0a,
0x06, 0x67, 0x7a, 0x69, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67,
0x7a, 0x69, 0x70, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xe1, 0x01, 0x0a, 0x07, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 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, 0x12, 0x0a, 0x04, 0x72, 0x6f,
0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x67, 0x7a, 0x69, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x67, 0x7a, 0x69, 0x70, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74,
0x12, 0x34, 0x0a, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x16, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64,
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -0,0 +1,672 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_http_header.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 创建Header
type CreateHTTPHeaderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *CreateHTTPHeaderRequest) Reset() {
*x = CreateHTTPHeaderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateHTTPHeaderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateHTTPHeaderRequest) ProtoMessage() {}
func (x *CreateHTTPHeaderRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateHTTPHeaderRequest.ProtoReflect.Descriptor instead.
func (*CreateHTTPHeaderRequest) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{0}
}
func (x *CreateHTTPHeaderRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CreateHTTPHeaderRequest) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
type CreateHTTPHeaderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HeaderId int64 `protobuf:"varint,1,opt,name=headerId,proto3" json:"headerId,omitempty"`
}
func (x *CreateHTTPHeaderResponse) Reset() {
*x = CreateHTTPHeaderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateHTTPHeaderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateHTTPHeaderResponse) ProtoMessage() {}
func (x *CreateHTTPHeaderResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateHTTPHeaderResponse.ProtoReflect.Descriptor instead.
func (*CreateHTTPHeaderResponse) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{1}
}
func (x *CreateHTTPHeaderResponse) GetHeaderId() int64 {
if x != nil {
return x.HeaderId
}
return 0
}
// 修改Header
type UpdateHTTPHeaderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HeaderId int64 `protobuf:"varint,1,opt,name=headerId,proto3" json:"headerId,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *UpdateHTTPHeaderRequest) Reset() {
*x = UpdateHTTPHeaderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPHeaderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPHeaderRequest) ProtoMessage() {}
func (x *UpdateHTTPHeaderRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPHeaderRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPHeaderRequest) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{2}
}
func (x *UpdateHTTPHeaderRequest) GetHeaderId() int64 {
if x != nil {
return x.HeaderId
}
return 0
}
func (x *UpdateHTTPHeaderRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *UpdateHTTPHeaderRequest) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
type UpdateHTTPHeaderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UpdateHTTPHeaderResponse) Reset() {
*x = UpdateHTTPHeaderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPHeaderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPHeaderResponse) ProtoMessage() {}
func (x *UpdateHTTPHeaderResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPHeaderResponse.ProtoReflect.Descriptor instead.
func (*UpdateHTTPHeaderResponse) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{3}
}
// 查找配置
type FindEnabledHTTPHeaderConfigRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HeaderId int64 `protobuf:"varint,1,opt,name=headerId,proto3" json:"headerId,omitempty"`
}
func (x *FindEnabledHTTPHeaderConfigRequest) Reset() {
*x = FindEnabledHTTPHeaderConfigRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledHTTPHeaderConfigRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledHTTPHeaderConfigRequest) ProtoMessage() {}
func (x *FindEnabledHTTPHeaderConfigRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FindEnabledHTTPHeaderConfigRequest.ProtoReflect.Descriptor instead.
func (*FindEnabledHTTPHeaderConfigRequest) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{4}
}
func (x *FindEnabledHTTPHeaderConfigRequest) GetHeaderId() int64 {
if x != nil {
return x.HeaderId
}
return 0
}
type FindEnabledHTTPHeaderConfigResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
}
func (x *FindEnabledHTTPHeaderConfigResponse) Reset() {
*x = FindEnabledHTTPHeaderConfigResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledHTTPHeaderConfigResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledHTTPHeaderConfigResponse) ProtoMessage() {}
func (x *FindEnabledHTTPHeaderConfigResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FindEnabledHTTPHeaderConfigResponse.ProtoReflect.Descriptor instead.
func (*FindEnabledHTTPHeaderConfigResponse) Descriptor() ([]byte, []int) {
return file_service_http_header_proto_rawDescGZIP(), []int{5}
}
func (x *FindEnabledHTTPHeaderConfigResponse) GetConfig() []byte {
if x != nil {
return x.Config
}
return nil
}
var File_service_http_header_proto protoreflect.FileDescriptor
var file_service_http_header_proto_rawDesc = []byte{
0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x68,
0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22,
0x43, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54,
0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x17,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65,
0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1a, 0x0a,
0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x22, 0x46, 0x69, 0x6e,
0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x23, 0x46,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xa1, 0x02, 0x0a, 0x11, 0x48,
0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x4d, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x4d, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48,
0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e,
0x0a, 0x1b, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54,
0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54,
0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_http_header_proto_rawDescOnce sync.Once
file_service_http_header_proto_rawDescData = file_service_http_header_proto_rawDesc
)
func file_service_http_header_proto_rawDescGZIP() []byte {
file_service_http_header_proto_rawDescOnce.Do(func() {
file_service_http_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_http_header_proto_rawDescData)
})
return file_service_http_header_proto_rawDescData
}
var file_service_http_header_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_service_http_header_proto_goTypes = []interface{}{
(*CreateHTTPHeaderRequest)(nil), // 0: pb.CreateHTTPHeaderRequest
(*CreateHTTPHeaderResponse)(nil), // 1: pb.CreateHTTPHeaderResponse
(*UpdateHTTPHeaderRequest)(nil), // 2: pb.UpdateHTTPHeaderRequest
(*UpdateHTTPHeaderResponse)(nil), // 3: pb.UpdateHTTPHeaderResponse
(*FindEnabledHTTPHeaderConfigRequest)(nil), // 4: pb.FindEnabledHTTPHeaderConfigRequest
(*FindEnabledHTTPHeaderConfigResponse)(nil), // 5: pb.FindEnabledHTTPHeaderConfigResponse
}
var file_service_http_header_proto_depIdxs = []int32{
0, // 0: pb.HTTPHeaderService.createHTTPHeader:input_type -> pb.CreateHTTPHeaderRequest
2, // 1: pb.HTTPHeaderService.updateHTTPHeader:input_type -> pb.UpdateHTTPHeaderRequest
4, // 2: pb.HTTPHeaderService.findEnabledHTTPHeaderConfig:input_type -> pb.FindEnabledHTTPHeaderConfigRequest
1, // 3: pb.HTTPHeaderService.createHTTPHeader:output_type -> pb.CreateHTTPHeaderResponse
3, // 4: pb.HTTPHeaderService.updateHTTPHeader:output_type -> pb.UpdateHTTPHeaderResponse
5, // 5: pb.HTTPHeaderService.findEnabledHTTPHeaderConfig:output_type -> pb.FindEnabledHTTPHeaderConfigResponse
3, // [3:6] is the sub-list for method output_type
0, // [0:3] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_service_http_header_proto_init() }
func file_service_http_header_proto_init() {
if File_service_http_header_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_service_http_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateHTTPHeaderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_header_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateHTTPHeaderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_header_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPHeaderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_header_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPHeaderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_header_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledHTTPHeaderConfigRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_header_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledHTTPHeaderConfigResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_http_header_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_http_header_proto_goTypes,
DependencyIndexes: file_service_http_header_proto_depIdxs,
MessageInfos: file_service_http_header_proto_msgTypes,
}.Build()
File_service_http_header_proto = out.File
file_service_http_header_proto_rawDesc = nil
file_service_http_header_proto_goTypes = nil
file_service_http_header_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// HTTPHeaderServiceClient is the client API for HTTPHeaderService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type HTTPHeaderServiceClient interface {
// 创建Header
CreateHTTPHeader(ctx context.Context, in *CreateHTTPHeaderRequest, opts ...grpc.CallOption) (*CreateHTTPHeaderResponse, error)
// 修改Header
UpdateHTTPHeader(ctx context.Context, in *UpdateHTTPHeaderRequest, opts ...grpc.CallOption) (*UpdateHTTPHeaderResponse, error)
// 查找配置
FindEnabledHTTPHeaderConfig(ctx context.Context, in *FindEnabledHTTPHeaderConfigRequest, opts ...grpc.CallOption) (*FindEnabledHTTPHeaderConfigResponse, error)
}
type hTTPHeaderServiceClient struct {
cc grpc.ClientConnInterface
}
func NewHTTPHeaderServiceClient(cc grpc.ClientConnInterface) HTTPHeaderServiceClient {
return &hTTPHeaderServiceClient{cc}
}
func (c *hTTPHeaderServiceClient) CreateHTTPHeader(ctx context.Context, in *CreateHTTPHeaderRequest, opts ...grpc.CallOption) (*CreateHTTPHeaderResponse, error) {
out := new(CreateHTTPHeaderResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPHeaderService/createHTTPHeader", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hTTPHeaderServiceClient) UpdateHTTPHeader(ctx context.Context, in *UpdateHTTPHeaderRequest, opts ...grpc.CallOption) (*UpdateHTTPHeaderResponse, error) {
out := new(UpdateHTTPHeaderResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPHeaderService/updateHTTPHeader", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hTTPHeaderServiceClient) FindEnabledHTTPHeaderConfig(ctx context.Context, in *FindEnabledHTTPHeaderConfigRequest, opts ...grpc.CallOption) (*FindEnabledHTTPHeaderConfigResponse, error) {
out := new(FindEnabledHTTPHeaderConfigResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPHeaderService/findEnabledHTTPHeaderConfig", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HTTPHeaderServiceServer is the server API for HTTPHeaderService service.
type HTTPHeaderServiceServer interface {
// 创建Header
CreateHTTPHeader(context.Context, *CreateHTTPHeaderRequest) (*CreateHTTPHeaderResponse, error)
// 修改Header
UpdateHTTPHeader(context.Context, *UpdateHTTPHeaderRequest) (*UpdateHTTPHeaderResponse, error)
// 查找配置
FindEnabledHTTPHeaderConfig(context.Context, *FindEnabledHTTPHeaderConfigRequest) (*FindEnabledHTTPHeaderConfigResponse, error)
}
// UnimplementedHTTPHeaderServiceServer can be embedded to have forward compatible implementations.
type UnimplementedHTTPHeaderServiceServer struct {
}
func (*UnimplementedHTTPHeaderServiceServer) CreateHTTPHeader(context.Context, *CreateHTTPHeaderRequest) (*CreateHTTPHeaderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateHTTPHeader not implemented")
}
func (*UnimplementedHTTPHeaderServiceServer) UpdateHTTPHeader(context.Context, *UpdateHTTPHeaderRequest) (*UpdateHTTPHeaderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPHeader not implemented")
}
func (*UnimplementedHTTPHeaderServiceServer) FindEnabledHTTPHeaderConfig(context.Context, *FindEnabledHTTPHeaderConfigRequest) (*FindEnabledHTTPHeaderConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledHTTPHeaderConfig not implemented")
}
func RegisterHTTPHeaderServiceServer(s *grpc.Server, srv HTTPHeaderServiceServer) {
s.RegisterService(&_HTTPHeaderService_serviceDesc, srv)
}
func _HTTPHeaderService_CreateHTTPHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateHTTPHeaderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPHeaderServiceServer).CreateHTTPHeader(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPHeaderService/CreateHTTPHeader",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPHeaderServiceServer).CreateHTTPHeader(ctx, req.(*CreateHTTPHeaderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HTTPHeaderService_UpdateHTTPHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPHeaderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPHeaderServiceServer).UpdateHTTPHeader(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPHeaderService/UpdateHTTPHeader",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPHeaderServiceServer).UpdateHTTPHeader(ctx, req.(*UpdateHTTPHeaderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HTTPHeaderService_FindEnabledHTTPHeaderConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindEnabledHTTPHeaderConfigRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPHeaderServiceServer).FindEnabledHTTPHeaderConfig(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPHeaderService/FindEnabledHTTPHeaderConfig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPHeaderServiceServer).FindEnabledHTTPHeaderConfig(ctx, req.(*FindEnabledHTTPHeaderConfigRequest))
}
return interceptor(ctx, in, info, handler)
}
var _HTTPHeaderService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.HTTPHeaderService",
HandlerType: (*HTTPHeaderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "createHTTPHeader",
Handler: _HTTPHeaderService_CreateHTTPHeader_Handler,
},
{
MethodName: "updateHTTPHeader",
Handler: _HTTPHeaderService_UpdateHTTPHeader_Handler,
},
{
MethodName: "findEnabledHTTPHeaderConfig",
Handler: _HTTPHeaderService_FindEnabledHTTPHeaderConfig_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_http_header.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -407,6 +407,288 @@ func (*UpdateHTTPWebGzipResponse) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{7}
}
// 更改字符集配置
type UpdateHTTPWebCharsetRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WebId int64 `protobuf:"varint,1,opt,name=webId,proto3" json:"webId,omitempty"`
Charset string `protobuf:"bytes,2,opt,name=charset,proto3" json:"charset,omitempty"`
}
func (x *UpdateHTTPWebCharsetRequest) Reset() {
*x = UpdateHTTPWebCharsetRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebCharsetRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebCharsetRequest) ProtoMessage() {}
func (x *UpdateHTTPWebCharsetRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebCharsetRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebCharsetRequest) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{8}
}
func (x *UpdateHTTPWebCharsetRequest) GetWebId() int64 {
if x != nil {
return x.WebId
}
return 0
}
func (x *UpdateHTTPWebCharsetRequest) GetCharset() string {
if x != nil {
return x.Charset
}
return ""
}
type UpdateHTTPWebCharsetResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UpdateHTTPWebCharsetResponse) Reset() {
*x = UpdateHTTPWebCharsetResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebCharsetResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebCharsetResponse) ProtoMessage() {}
func (x *UpdateHTTPWebCharsetResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebCharsetResponse.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebCharsetResponse) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{9}
}
// 更改请求Header策略
type UpdateHTTPWebRequestHeaderPolicyRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WebId int64 `protobuf:"varint,1,opt,name=webId,proto3" json:"webId,omitempty"`
HeaderPolicyId int64 `protobuf:"varint,2,opt,name=headerPolicyId,proto3" json:"headerPolicyId,omitempty"`
}
func (x *UpdateHTTPWebRequestHeaderPolicyRequest) Reset() {
*x = UpdateHTTPWebRequestHeaderPolicyRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebRequestHeaderPolicyRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebRequestHeaderPolicyRequest) ProtoMessage() {}
func (x *UpdateHTTPWebRequestHeaderPolicyRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebRequestHeaderPolicyRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebRequestHeaderPolicyRequest) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{10}
}
func (x *UpdateHTTPWebRequestHeaderPolicyRequest) GetWebId() int64 {
if x != nil {
return x.WebId
}
return 0
}
func (x *UpdateHTTPWebRequestHeaderPolicyRequest) GetHeaderPolicyId() int64 {
if x != nil {
return x.HeaderPolicyId
}
return 0
}
type UpdateHTTPWebRequestHeaderPolicyResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UpdateHTTPWebRequestHeaderPolicyResponse) Reset() {
*x = UpdateHTTPWebRequestHeaderPolicyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebRequestHeaderPolicyResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebRequestHeaderPolicyResponse) ProtoMessage() {}
func (x *UpdateHTTPWebRequestHeaderPolicyResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebRequestHeaderPolicyResponse.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebRequestHeaderPolicyResponse) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{11}
}
// 更改响应Header策略
type UpdateHTTPWebResponseHeaderPolicyRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WebId int64 `protobuf:"varint,1,opt,name=webId,proto3" json:"webId,omitempty"`
HeaderPolicyId int64 `protobuf:"varint,2,opt,name=headerPolicyId,proto3" json:"headerPolicyId,omitempty"`
}
func (x *UpdateHTTPWebResponseHeaderPolicyRequest) Reset() {
*x = UpdateHTTPWebResponseHeaderPolicyRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebResponseHeaderPolicyRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebResponseHeaderPolicyRequest) ProtoMessage() {}
func (x *UpdateHTTPWebResponseHeaderPolicyRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebResponseHeaderPolicyRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebResponseHeaderPolicyRequest) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{12}
}
func (x *UpdateHTTPWebResponseHeaderPolicyRequest) GetWebId() int64 {
if x != nil {
return x.WebId
}
return 0
}
func (x *UpdateHTTPWebResponseHeaderPolicyRequest) GetHeaderPolicyId() int64 {
if x != nil {
return x.HeaderPolicyId
}
return 0
}
type UpdateHTTPWebResponseHeaderPolicyResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UpdateHTTPWebResponseHeaderPolicyResponse) Reset() {
*x = UpdateHTTPWebResponseHeaderPolicyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_web_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPWebResponseHeaderPolicyResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPWebResponseHeaderPolicyResponse) ProtoMessage() {}
func (x *UpdateHTTPWebResponseHeaderPolicyResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_http_web_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPWebResponseHeaderPolicyResponse.ProtoReflect.Descriptor instead.
func (*UpdateHTTPWebResponseHeaderPolicyResponse) Descriptor() ([]byte, []int) {
return file_service_http_web_proto_rawDescGZIP(), []int{13}
}
var File_service_http_web_proto protoreflect.FileDescriptor
var file_service_http_web_proto_rawDesc = []byte{
@@ -437,29 +719,76 @@ var file_service_http_web_proto_rawDesc = []byte{
0x01, 0x28, 0x03, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x7a,
0x69, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x7a, 0x69, 0x70,
0x49, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
0xc3, 0x02, 0x0a, 0x0e, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x57, 0x65, 0x62, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x12, 0x1d,
0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54,
0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a,
0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x12, 0x18,
0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x4d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62,
0x43, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14,
0x0a, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x77,
0x65, 0x62, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x22, 0x1e,
0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x43,
0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67,
0x0a, 0x27, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x65, 0x62,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x12,
0x26, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x28, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x68, 0x0a, 0x28, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x14, 0x0a, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x68,
0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x22, 0x2b, 0x0a,
0x29, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa0, 0x05, 0x0a, 0x0e, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a,
0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x12, 0x18,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65,
0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65,
0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50,
0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x47,
0x7a, 0x69, 0x70, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48,
0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x59, 0x0a, 0x14, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65,
0x62, 0x43, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x43, 0x68, 0x61, 0x72, 0x73,
0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x43, 0x68, 0x61, 0x72,
0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7d, 0x0a, 0x20, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
0x2b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57,
0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x70,
0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x21, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x12, 0x2c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65,
0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x57, 0x65, 0x62, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -474,33 +803,45 @@ func file_service_http_web_proto_rawDescGZIP() []byte {
return file_service_http_web_proto_rawDescData
}
var file_service_http_web_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_service_http_web_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_service_http_web_proto_goTypes = []interface{}{
(*CreateHTTPWebRequest)(nil), // 0: pb.CreateHTTPWebRequest
(*CreateHTTPWebResponse)(nil), // 1: pb.CreateHTTPWebResponse
(*FindEnabledHTTPWebRequest)(nil), // 2: pb.FindEnabledHTTPWebRequest
(*FindEnabledHTTPWebResponse)(nil), // 3: pb.FindEnabledHTTPWebResponse
(*UpdateHTTPWebRequest)(nil), // 4: pb.UpdateHTTPWebRequest
(*UpdateHTTPWebResponse)(nil), // 5: pb.UpdateHTTPWebResponse
(*UpdateHTTPWebGzipRequest)(nil), // 6: pb.UpdateHTTPWebGzipRequest
(*UpdateHTTPWebGzipResponse)(nil), // 7: pb.UpdateHTTPWebGzipResponse
(*HTTPWeb)(nil), // 8: pb.HTTPWeb
(*CreateHTTPWebRequest)(nil), // 0: pb.CreateHTTPWebRequest
(*CreateHTTPWebResponse)(nil), // 1: pb.CreateHTTPWebResponse
(*FindEnabledHTTPWebRequest)(nil), // 2: pb.FindEnabledHTTPWebRequest
(*FindEnabledHTTPWebResponse)(nil), // 3: pb.FindEnabledHTTPWebResponse
(*UpdateHTTPWebRequest)(nil), // 4: pb.UpdateHTTPWebRequest
(*UpdateHTTPWebResponse)(nil), // 5: pb.UpdateHTTPWebResponse
(*UpdateHTTPWebGzipRequest)(nil), // 6: pb.UpdateHTTPWebGzipRequest
(*UpdateHTTPWebGzipResponse)(nil), // 7: pb.UpdateHTTPWebGzipResponse
(*UpdateHTTPWebCharsetRequest)(nil), // 8: pb.UpdateHTTPWebCharsetRequest
(*UpdateHTTPWebCharsetResponse)(nil), // 9: pb.UpdateHTTPWebCharsetResponse
(*UpdateHTTPWebRequestHeaderPolicyRequest)(nil), // 10: pb.UpdateHTTPWebRequestHeaderPolicyRequest
(*UpdateHTTPWebRequestHeaderPolicyResponse)(nil), // 11: pb.UpdateHTTPWebRequestHeaderPolicyResponse
(*UpdateHTTPWebResponseHeaderPolicyRequest)(nil), // 12: pb.UpdateHTTPWebResponseHeaderPolicyRequest
(*UpdateHTTPWebResponseHeaderPolicyResponse)(nil), // 13: pb.UpdateHTTPWebResponseHeaderPolicyResponse
(*HTTPWeb)(nil), // 14: pb.HTTPWeb
}
var file_service_http_web_proto_depIdxs = []int32{
8, // 0: pb.FindEnabledHTTPWebResponse.web:type_name -> pb.HTTPWeb
0, // 1: pb.HTTPWebService.createHTTPWeb:input_type -> pb.CreateHTTPWebRequest
2, // 2: pb.HTTPWebService.findEnabledHTTPWeb:input_type -> pb.FindEnabledHTTPWebRequest
4, // 3: pb.HTTPWebService.updateHTTPWeb:input_type -> pb.UpdateHTTPWebRequest
6, // 4: pb.HTTPWebService.updateHTTPWebGzip:input_type -> pb.UpdateHTTPWebGzipRequest
1, // 5: pb.HTTPWebService.createHTTPWeb:output_type -> pb.CreateHTTPWebResponse
3, // 6: pb.HTTPWebService.findEnabledHTTPWeb:output_type -> pb.FindEnabledHTTPWebResponse
5, // 7: pb.HTTPWebService.updateHTTPWeb:output_type -> pb.UpdateHTTPWebResponse
7, // 8: pb.HTTPWebService.updateHTTPWebGzip:output_type -> pb.UpdateHTTPWebGzipResponse
5, // [5:9] is the sub-list for method output_type
1, // [1:5] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
14, // 0: pb.FindEnabledHTTPWebResponse.web:type_name -> pb.HTTPWeb
0, // 1: pb.HTTPWebService.createHTTPWeb:input_type -> pb.CreateHTTPWebRequest
2, // 2: pb.HTTPWebService.findEnabledHTTPWeb:input_type -> pb.FindEnabledHTTPWebRequest
4, // 3: pb.HTTPWebService.updateHTTPWeb:input_type -> pb.UpdateHTTPWebRequest
6, // 4: pb.HTTPWebService.updateHTTPWebGzip:input_type -> pb.UpdateHTTPWebGzipRequest
8, // 5: pb.HTTPWebService.updateHTTPWebCharset:input_type -> pb.UpdateHTTPWebCharsetRequest
10, // 6: pb.HTTPWebService.updateHTTPWebRequestHeaderPolicy:input_type -> pb.UpdateHTTPWebRequestHeaderPolicyRequest
12, // 7: pb.HTTPWebService.updateHTTPWebResponseHeaderPolicy:input_type -> pb.UpdateHTTPWebResponseHeaderPolicyRequest
1, // 8: pb.HTTPWebService.createHTTPWeb:output_type -> pb.CreateHTTPWebResponse
3, // 9: pb.HTTPWebService.findEnabledHTTPWeb:output_type -> pb.FindEnabledHTTPWebResponse
5, // 10: pb.HTTPWebService.updateHTTPWeb:output_type -> pb.UpdateHTTPWebResponse
7, // 11: pb.HTTPWebService.updateHTTPWebGzip:output_type -> pb.UpdateHTTPWebGzipResponse
9, // 12: pb.HTTPWebService.updateHTTPWebCharset:output_type -> pb.UpdateHTTPWebCharsetResponse
11, // 13: pb.HTTPWebService.updateHTTPWebRequestHeaderPolicy:output_type -> pb.UpdateHTTPWebRequestHeaderPolicyResponse
13, // 14: pb.HTTPWebService.updateHTTPWebResponseHeaderPolicy:output_type -> pb.UpdateHTTPWebResponseHeaderPolicyResponse
8, // [8:15] is the sub-list for method output_type
1, // [1:8] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_service_http_web_proto_init() }
@@ -606,6 +947,78 @@ func file_service_http_web_proto_init() {
return nil
}
}
file_service_http_web_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebCharsetRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_web_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebCharsetResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_web_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebRequestHeaderPolicyRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_web_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebRequestHeaderPolicyResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_web_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebResponseHeaderPolicyRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_http_web_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPWebResponseHeaderPolicyResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -613,7 +1026,7 @@ func file_service_http_web_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_http_web_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 14,
NumExtensions: 0,
NumServices: 1,
},
@@ -647,6 +1060,12 @@ type HTTPWebServiceClient interface {
UpdateHTTPWeb(ctx context.Context, in *UpdateHTTPWebRequest, opts ...grpc.CallOption) (*UpdateHTTPWebResponse, error)
// 更改Gzip配置
UpdateHTTPWebGzip(ctx context.Context, in *UpdateHTTPWebGzipRequest, opts ...grpc.CallOption) (*UpdateHTTPWebGzipResponse, error)
// 更改字符集配置
UpdateHTTPWebCharset(ctx context.Context, in *UpdateHTTPWebCharsetRequest, opts ...grpc.CallOption) (*UpdateHTTPWebCharsetResponse, error)
// 更改请求Header策略
UpdateHTTPWebRequestHeaderPolicy(ctx context.Context, in *UpdateHTTPWebRequestHeaderPolicyRequest, opts ...grpc.CallOption) (*UpdateHTTPWebRequestHeaderPolicyResponse, error)
// 更改响应Header策略
UpdateHTTPWebResponseHeaderPolicy(ctx context.Context, in *UpdateHTTPWebResponseHeaderPolicyRequest, opts ...grpc.CallOption) (*UpdateHTTPWebResponseHeaderPolicyResponse, error)
}
type hTTPWebServiceClient struct {
@@ -693,6 +1112,33 @@ func (c *hTTPWebServiceClient) UpdateHTTPWebGzip(ctx context.Context, in *Update
return out, nil
}
func (c *hTTPWebServiceClient) UpdateHTTPWebCharset(ctx context.Context, in *UpdateHTTPWebCharsetRequest, opts ...grpc.CallOption) (*UpdateHTTPWebCharsetResponse, error) {
out := new(UpdateHTTPWebCharsetResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPWebService/updateHTTPWebCharset", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hTTPWebServiceClient) UpdateHTTPWebRequestHeaderPolicy(ctx context.Context, in *UpdateHTTPWebRequestHeaderPolicyRequest, opts ...grpc.CallOption) (*UpdateHTTPWebRequestHeaderPolicyResponse, error) {
out := new(UpdateHTTPWebRequestHeaderPolicyResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPWebService/updateHTTPWebRequestHeaderPolicy", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hTTPWebServiceClient) UpdateHTTPWebResponseHeaderPolicy(ctx context.Context, in *UpdateHTTPWebResponseHeaderPolicyRequest, opts ...grpc.CallOption) (*UpdateHTTPWebResponseHeaderPolicyResponse, error) {
out := new(UpdateHTTPWebResponseHeaderPolicyResponse)
err := c.cc.Invoke(ctx, "/pb.HTTPWebService/updateHTTPWebResponseHeaderPolicy", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HTTPWebServiceServer is the server API for HTTPWebService service.
type HTTPWebServiceServer interface {
// 创建Web配置
@@ -703,6 +1149,12 @@ type HTTPWebServiceServer interface {
UpdateHTTPWeb(context.Context, *UpdateHTTPWebRequest) (*UpdateHTTPWebResponse, error)
// 更改Gzip配置
UpdateHTTPWebGzip(context.Context, *UpdateHTTPWebGzipRequest) (*UpdateHTTPWebGzipResponse, error)
// 更改字符集配置
UpdateHTTPWebCharset(context.Context, *UpdateHTTPWebCharsetRequest) (*UpdateHTTPWebCharsetResponse, error)
// 更改请求Header策略
UpdateHTTPWebRequestHeaderPolicy(context.Context, *UpdateHTTPWebRequestHeaderPolicyRequest) (*UpdateHTTPWebRequestHeaderPolicyResponse, error)
// 更改响应Header策略
UpdateHTTPWebResponseHeaderPolicy(context.Context, *UpdateHTTPWebResponseHeaderPolicyRequest) (*UpdateHTTPWebResponseHeaderPolicyResponse, error)
}
// UnimplementedHTTPWebServiceServer can be embedded to have forward compatible implementations.
@@ -721,6 +1173,15 @@ func (*UnimplementedHTTPWebServiceServer) UpdateHTTPWeb(context.Context, *Update
func (*UnimplementedHTTPWebServiceServer) UpdateHTTPWebGzip(context.Context, *UpdateHTTPWebGzipRequest) (*UpdateHTTPWebGzipResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPWebGzip not implemented")
}
func (*UnimplementedHTTPWebServiceServer) UpdateHTTPWebCharset(context.Context, *UpdateHTTPWebCharsetRequest) (*UpdateHTTPWebCharsetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPWebCharset not implemented")
}
func (*UnimplementedHTTPWebServiceServer) UpdateHTTPWebRequestHeaderPolicy(context.Context, *UpdateHTTPWebRequestHeaderPolicyRequest) (*UpdateHTTPWebRequestHeaderPolicyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPWebRequestHeaderPolicy not implemented")
}
func (*UnimplementedHTTPWebServiceServer) UpdateHTTPWebResponseHeaderPolicy(context.Context, *UpdateHTTPWebResponseHeaderPolicyRequest) (*UpdateHTTPWebResponseHeaderPolicyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPWebResponseHeaderPolicy not implemented")
}
func RegisterHTTPWebServiceServer(s *grpc.Server, srv HTTPWebServiceServer) {
s.RegisterService(&_HTTPWebService_serviceDesc, srv)
@@ -798,6 +1259,60 @@ func _HTTPWebService_UpdateHTTPWebGzip_Handler(srv interface{}, ctx context.Cont
return interceptor(ctx, in, info, handler)
}
func _HTTPWebService_UpdateHTTPWebCharset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPWebCharsetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPWebServiceServer).UpdateHTTPWebCharset(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPWebService/UpdateHTTPWebCharset",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPWebServiceServer).UpdateHTTPWebCharset(ctx, req.(*UpdateHTTPWebCharsetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HTTPWebService_UpdateHTTPWebRequestHeaderPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPWebRequestHeaderPolicyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPWebServiceServer).UpdateHTTPWebRequestHeaderPolicy(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPWebService/UpdateHTTPWebRequestHeaderPolicy",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPWebServiceServer).UpdateHTTPWebRequestHeaderPolicy(ctx, req.(*UpdateHTTPWebRequestHeaderPolicyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HTTPWebService_UpdateHTTPWebResponseHeaderPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPWebResponseHeaderPolicyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPWebServiceServer).UpdateHTTPWebResponseHeaderPolicy(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPWebService/UpdateHTTPWebResponseHeaderPolicy",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPWebServiceServer).UpdateHTTPWebResponseHeaderPolicy(ctx, req.(*UpdateHTTPWebResponseHeaderPolicyRequest))
}
return interceptor(ctx, in, info, handler)
}
var _HTTPWebService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.HTTPWebService",
HandlerType: (*HTTPWebServiceServer)(nil),
@@ -818,6 +1333,18 @@ var _HTTPWebService_serviceDesc = grpc.ServiceDesc{
MethodName: "updateHTTPWebGzip",
Handler: _HTTPWebService_UpdateHTTPWebGzip_Handler,
},
{
MethodName: "updateHTTPWebCharset",
Handler: _HTTPWebService_UpdateHTTPWebCharset_Handler,
},
{
MethodName: "updateHTTPWebRequestHeaderPolicy",
Handler: _HTTPWebService_UpdateHTTPWebRequestHeaderPolicy_Handler,
},
{
MethodName: "updateHTTPWebResponseHeaderPolicy",
Handler: _HTTPWebService_UpdateHTTPWebResponseHeaderPolicy_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_http_web.proto",

View File

@@ -1762,7 +1762,7 @@ func (x *FindServerReverseProxyConfigResponse) GetConfig() []byte {
}
// 初始化Web设置
type InitServerWebRequest struct {
type FindAndInitServerWebRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -1770,8 +1770,8 @@ type InitServerWebRequest struct {
ServerId int64 `protobuf:"varint,1,opt,name=serverId,proto3" json:"serverId,omitempty"`
}
func (x *InitServerWebRequest) Reset() {
*x = InitServerWebRequest{}
func (x *FindAndInitServerWebRequest) Reset() {
*x = FindAndInitServerWebRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_server_proto_msgTypes[34]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1779,13 +1779,13 @@ func (x *InitServerWebRequest) Reset() {
}
}
func (x *InitServerWebRequest) String() string {
func (x *FindAndInitServerWebRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InitServerWebRequest) ProtoMessage() {}
func (*FindAndInitServerWebRequest) ProtoMessage() {}
func (x *InitServerWebRequest) ProtoReflect() protoreflect.Message {
func (x *FindAndInitServerWebRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_server_proto_msgTypes[34]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1797,28 +1797,28 @@ func (x *InitServerWebRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use InitServerWebRequest.ProtoReflect.Descriptor instead.
func (*InitServerWebRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use FindAndInitServerWebRequest.ProtoReflect.Descriptor instead.
func (*FindAndInitServerWebRequest) Descriptor() ([]byte, []int) {
return file_service_server_proto_rawDescGZIP(), []int{34}
}
func (x *InitServerWebRequest) GetServerId() int64 {
func (x *FindAndInitServerWebRequest) GetServerId() int64 {
if x != nil {
return x.ServerId
}
return 0
}
type InitServerWebResponse struct {
type FindAndInitServerWebResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WebId int64 `protobuf:"varint,1,opt,name=webId,proto3" json:"webId,omitempty"`
Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
}
func (x *InitServerWebResponse) Reset() {
*x = InitServerWebResponse{}
func (x *FindAndInitServerWebResponse) Reset() {
*x = FindAndInitServerWebResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_server_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1826,13 +1826,13 @@ func (x *InitServerWebResponse) Reset() {
}
}
func (x *InitServerWebResponse) String() string {
func (x *FindAndInitServerWebResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InitServerWebResponse) ProtoMessage() {}
func (*FindAndInitServerWebResponse) ProtoMessage() {}
func (x *InitServerWebResponse) ProtoReflect() protoreflect.Message {
func (x *FindAndInitServerWebResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_server_proto_msgTypes[35]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1844,16 +1844,16 @@ func (x *InitServerWebResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use InitServerWebResponse.ProtoReflect.Descriptor instead.
func (*InitServerWebResponse) Descriptor() ([]byte, []int) {
// Deprecated: Use FindAndInitServerWebResponse.ProtoReflect.Descriptor instead.
func (*FindAndInitServerWebResponse) Descriptor() ([]byte, []int) {
return file_service_server_proto_rawDescGZIP(), []int{35}
}
func (x *InitServerWebResponse) GetWebId() int64 {
func (x *FindAndInitServerWebResponse) GetConfig() []byte {
if x != nil {
return x.WebId
return x.Config
}
return 0
return nil
}
var File_service_server_proto protoreflect.FileDescriptor
@@ -2012,14 +2012,15 @@ var file_service_server_proto_rawDesc = []byte{
0x24, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x76, 0x65, 0x72,
0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x32, 0x0a,
0x14, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x22, 0x2d, 0x0a, 0x15, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x57,
0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x65,
0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64,
0x32, 0xe2, 0x0b, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x39, 0x0a,
0x1b, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x1c, 0x46, 0x69, 0x6e, 0x64,
0x41, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x32, 0xfd, 0x0b, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62,
@@ -2109,12 +2110,13 @@ var file_service_server_proto_rawDesc = []byte{
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78,
0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x44, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62,
0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e,
0x49, 0x6e, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x5f, 0x0a, 0x1a, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20,
0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -2165,8 +2167,8 @@ var file_service_server_proto_goTypes = []interface{}{
(*FindEnabledServerTypeResponse)(nil), // 31: pb.FindEnabledServerTypeResponse
(*FindServerReverseProxyConfigRequest)(nil), // 32: pb.FindServerReverseProxyConfigRequest
(*FindServerReverseProxyConfigResponse)(nil), // 33: pb.FindServerReverseProxyConfigResponse
(*InitServerWebRequest)(nil), // 34: pb.InitServerWebRequest
(*InitServerWebResponse)(nil), // 35: pb.InitServerWebResponse
(*FindAndInitServerWebRequest)(nil), // 34: pb.FindAndInitServerWebRequest
(*FindAndInitServerWebResponse)(nil), // 35: pb.FindAndInitServerWebResponse
(*Server)(nil), // 36: pb.Server
}
var file_service_server_proto_depIdxs = []int32{
@@ -2189,7 +2191,7 @@ var file_service_server_proto_depIdxs = []int32{
28, // 16: pb.ServerService.findEnabledServer:input_type -> pb.FindEnabledServerRequest
30, // 17: pb.ServerService.findEnabledServerType:input_type -> pb.FindEnabledServerTypeRequest
32, // 18: pb.ServerService.findServerReverseProxyConfig:input_type -> pb.FindServerReverseProxyConfigRequest
34, // 19: pb.ServerService.initServerWeb:input_type -> pb.InitServerWebRequest
34, // 19: pb.ServerService.findAndInitServerWebConfig:input_type -> pb.FindAndInitServerWebRequest
1, // 20: pb.ServerService.createServer:output_type -> pb.CreateServerResponse
3, // 21: pb.ServerService.updateServerBasic:output_type -> pb.UpdateServerBasicResponse
5, // 22: pb.ServerService.updateServerHTTP:output_type -> pb.UpdateServerHTTPResponse
@@ -2207,7 +2209,7 @@ var file_service_server_proto_depIdxs = []int32{
29, // 34: pb.ServerService.findEnabledServer:output_type -> pb.FindEnabledServerResponse
31, // 35: pb.ServerService.findEnabledServerType:output_type -> pb.FindEnabledServerTypeResponse
33, // 36: pb.ServerService.findServerReverseProxyConfig:output_type -> pb.FindServerReverseProxyConfigResponse
35, // 37: pb.ServerService.initServerWeb:output_type -> pb.InitServerWebResponse
35, // 37: pb.ServerService.findAndInitServerWebConfig:output_type -> pb.FindAndInitServerWebResponse
20, // [20:38] is the sub-list for method output_type
2, // [2:20] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
@@ -2631,7 +2633,7 @@ func file_service_server_proto_init() {
}
}
file_service_server_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InitServerWebRequest); i {
switch v := v.(*FindAndInitServerWebRequest); i {
case 0:
return &v.state
case 1:
@@ -2643,7 +2645,7 @@ func file_service_server_proto_init() {
}
}
file_service_server_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InitServerWebResponse); i {
switch v := v.(*FindAndInitServerWebResponse); i {
case 0:
return &v.state
case 1:
@@ -2722,7 +2724,7 @@ type ServerServiceClient interface {
// 查找反向代理设置
FindServerReverseProxyConfig(ctx context.Context, in *FindServerReverseProxyConfigRequest, opts ...grpc.CallOption) (*FindServerReverseProxyConfigResponse, error)
// 初始化Web设置
InitServerWeb(ctx context.Context, in *InitServerWebRequest, opts ...grpc.CallOption) (*InitServerWebResponse, error)
FindAndInitServerWebConfig(ctx context.Context, in *FindAndInitServerWebRequest, opts ...grpc.CallOption) (*FindAndInitServerWebResponse, error)
}
type serverServiceClient struct {
@@ -2886,9 +2888,9 @@ func (c *serverServiceClient) FindServerReverseProxyConfig(ctx context.Context,
return out, nil
}
func (c *serverServiceClient) InitServerWeb(ctx context.Context, in *InitServerWebRequest, opts ...grpc.CallOption) (*InitServerWebResponse, error) {
out := new(InitServerWebResponse)
err := c.cc.Invoke(ctx, "/pb.ServerService/initServerWeb", in, out, opts...)
func (c *serverServiceClient) FindAndInitServerWebConfig(ctx context.Context, in *FindAndInitServerWebRequest, opts ...grpc.CallOption) (*FindAndInitServerWebResponse, error) {
out := new(FindAndInitServerWebResponse)
err := c.cc.Invoke(ctx, "/pb.ServerService/findAndInitServerWebConfig", in, out, opts...)
if err != nil {
return nil, err
}
@@ -2932,7 +2934,7 @@ type ServerServiceServer interface {
// 查找反向代理设置
FindServerReverseProxyConfig(context.Context, *FindServerReverseProxyConfigRequest) (*FindServerReverseProxyConfigResponse, error)
// 初始化Web设置
InitServerWeb(context.Context, *InitServerWebRequest) (*InitServerWebResponse, error)
FindAndInitServerWebConfig(context.Context, *FindAndInitServerWebRequest) (*FindAndInitServerWebResponse, error)
}
// UnimplementedServerServiceServer can be embedded to have forward compatible implementations.
@@ -2990,8 +2992,8 @@ func (*UnimplementedServerServiceServer) FindEnabledServerType(context.Context,
func (*UnimplementedServerServiceServer) FindServerReverseProxyConfig(context.Context, *FindServerReverseProxyConfigRequest) (*FindServerReverseProxyConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindServerReverseProxyConfig not implemented")
}
func (*UnimplementedServerServiceServer) InitServerWeb(context.Context, *InitServerWebRequest) (*InitServerWebResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method InitServerWeb not implemented")
func (*UnimplementedServerServiceServer) FindAndInitServerWebConfig(context.Context, *FindAndInitServerWebRequest) (*FindAndInitServerWebResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAndInitServerWebConfig not implemented")
}
func RegisterServerServiceServer(s *grpc.Server, srv ServerServiceServer) {
@@ -3304,20 +3306,20 @@ func _ServerService_FindServerReverseProxyConfig_Handler(srv interface{}, ctx co
return interceptor(ctx, in, info, handler)
}
func _ServerService_InitServerWeb_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InitServerWebRequest)
func _ServerService_FindAndInitServerWebConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindAndInitServerWebRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServerServiceServer).InitServerWeb(ctx, in)
return srv.(ServerServiceServer).FindAndInitServerWebConfig(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ServerService/InitServerWeb",
FullMethod: "/pb.ServerService/FindAndInitServerWebConfig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServerServiceServer).InitServerWeb(ctx, req.(*InitServerWebRequest))
return srv.(ServerServiceServer).FindAndInitServerWebConfig(ctx, req.(*FindAndInitServerWebRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -3395,8 +3397,8 @@ var _ServerService_serviceDesc = grpc.ServiceDesc{
Handler: _ServerService_FindServerReverseProxyConfig_Handler,
},
{
MethodName: "initServerWeb",
Handler: _ServerService_InitServerWeb_Handler,
MethodName: "findAndInitServerWebConfig",
Handler: _ServerService_FindAndInitServerWebConfig_Handler,
},
},
Streams: []grpc.StreamDesc{},

View File

@@ -8,4 +8,7 @@ message HTTPWeb {
bool isOn = 2;
string root = 3;
int64 gzipId = 4;
string charset = 5;
int64 requestHeaderPolicyId = 6;
int64 responseHeaderPolicyId = 7;
}

View File

@@ -0,0 +1,45 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
service HTTPHeaderService {
// 创建Header
rpc createHTTPHeader (CreateHTTPHeaderRequest) returns (CreateHTTPHeaderResponse);
// 修改Header
rpc updateHTTPHeader (UpdateHTTPHeaderRequest) returns (UpdateHTTPHeaderResponse);
// 查找配置
rpc findEnabledHTTPHeaderConfig (FindEnabledHTTPHeaderConfigRequest) returns (FindEnabledHTTPHeaderConfigResponse);
}
// 创建Header
message CreateHTTPHeaderRequest {
string name = 1;
string value = 2;
}
message CreateHTTPHeaderResponse {
int64 headerId = 1;
}
// 修改Header
message UpdateHTTPHeaderRequest {
int64 headerId = 1;
string name = 2;
string value = 3;
}
message UpdateHTTPHeaderResponse {
}
// 查找配置
message FindEnabledHTTPHeaderConfigRequest {
int64 headerId = 1;
}
message FindEnabledHTTPHeaderConfigResponse {
bytes config = 1;
}

View File

@@ -0,0 +1,95 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
service HTTPHeaderPolicyService {
// 查找策略配置
rpc findEnabledHTTPHeaderPolicyConfig (FindEnabledHTTPHeaderPolicyConfigRequest) returns (FindEnabledHTTPHeaderPolicyConfigResponse);
// 创建策略
rpc createHTTPHeaderPolicy (CreateHTTPHeaderPolicyRequest) returns (CreateHTTPHeaderPolicyResponse);
// 修改AddHeaders
rpc updateHTTPHeaderPolicyAddingHeaders (UpdateHTTPHeaderPolicyAddingHeadersRequest) returns (UpdateHTTPHeaderPolicyAddingHeadersResponse);
// 修改SetHeaders
rpc updateHTTPHeaderPolicySettingHeaders (UpdateHTTPHeaderPolicySettingHeadersRequest) returns (UpdateHTTPHeaderPolicySettingHeadersResponse);
// 修改AddTrailers
rpc updateHTTPHeaderPolicyAddingTrailers (UpdateHTTPHeaderPolicyAddingTrailersRequest) returns (UpdateHTTPHeaderPolicyAddingTrailersResponse);
// 修改ReplaceHeaders
rpc updateHTTPHeaderPolicyReplacingHeaders (UpdateHTTPHeaderPolicyReplacingHeadersRequest) returns (UpdateHTTPHeaderPolicyReplacingHeadersResponse);
// 修改删除的Headers
rpc updateHTTPHeaderPolicyDeletingHeaders (UpdateHTTPHeaderPolicyDeletingHeadersRequest) returns (UpdateHTTPHeaderPolicyDeletingHeadersResponse);
}
// 查找策略
message FindEnabledHTTPHeaderPolicyConfigRequest {
int64 headerPolicyId = 1;
}
message FindEnabledHTTPHeaderPolicyConfigResponse {
bytes config = 1;
}
// 创建策略
message CreateHTTPHeaderPolicyRequest {
}
message CreateHTTPHeaderPolicyResponse {
int64 headerPolicyId = 1;
}
// 修改AddHeaders
message UpdateHTTPHeaderPolicyAddingHeadersRequest {
int64 headerPolicyId = 1;
bytes headersJSON = 2;
}
message UpdateHTTPHeaderPolicyAddingHeadersResponse {
}
// 修改SetHeaders
message UpdateHTTPHeaderPolicySettingHeadersRequest {
int64 headerPolicyId = 1;
bytes headersJSON = 2;
}
message UpdateHTTPHeaderPolicySettingHeadersResponse {
}
// 修改AddTrailers
message UpdateHTTPHeaderPolicyAddingTrailersRequest {
int64 headerPolicyId = 1;
bytes headersJSON = 2;
}
message UpdateHTTPHeaderPolicyAddingTrailersResponse {
}
// 修改ReplaceHeaders
message UpdateHTTPHeaderPolicyReplacingHeadersRequest {
int64 headerPolicyId = 1;
bytes headersJSON = 2;
}
message UpdateHTTPHeaderPolicyReplacingHeadersResponse {
}
// 修改删除的Headers
message UpdateHTTPHeaderPolicyDeletingHeadersRequest {
int64 headerPolicyId = 1;
repeated string headerNames = 2;
}
message UpdateHTTPHeaderPolicyDeletingHeadersResponse {
}

View File

@@ -17,6 +17,15 @@ service HTTPWebService {
// 更改Gzip配置
rpc updateHTTPWebGzip (UpdateHTTPWebGzipRequest) returns (UpdateHTTPWebGzipResponse);
// 更改字符集配置
rpc updateHTTPWebCharset (UpdateHTTPWebCharsetRequest) returns (UpdateHTTPWebCharsetResponse);
// 更改请求Header策略
rpc updateHTTPWebRequestHeaderPolicy (UpdateHTTPWebRequestHeaderPolicyRequest) returns (UpdateHTTPWebRequestHeaderPolicyResponse);
// 更改响应Header策略
rpc updateHTTPWebResponseHeaderPolicy (UpdateHTTPWebResponseHeaderPolicyRequest) returns (UpdateHTTPWebResponseHeaderPolicyResponse);
}
// 创建Web配置
@@ -55,4 +64,34 @@ message UpdateHTTPWebGzipRequest {
message UpdateHTTPWebGzipResponse {
}
// 更改字符集配置
message UpdateHTTPWebCharsetRequest {
int64 webId = 1;
string charset = 2;
}
message UpdateHTTPWebCharsetResponse {
}
// 更改请求Header策略
message UpdateHTTPWebRequestHeaderPolicyRequest {
int64 webId = 1;
int64 headerPolicyId = 2;
}
message UpdateHTTPWebRequestHeaderPolicyResponse {
}
// 更改响应Header策略
message UpdateHTTPWebResponseHeaderPolicyRequest {
int64 webId = 1;
int64 headerPolicyId = 2;
}
message UpdateHTTPWebResponseHeaderPolicyResponse {
}

View File

@@ -57,7 +57,7 @@ service ServerService {
rpc findServerReverseProxyConfig (FindServerReverseProxyConfigRequest) returns (FindServerReverseProxyConfigResponse);
// 初始化Web设置
rpc initServerWeb (InitServerWebRequest) returns (InitServerWebResponse);
rpc findAndInitServerWebConfig (FindAndInitServerWebRequest) returns (FindAndInitServerWebResponse);
}
// 创建服务
@@ -238,10 +238,10 @@ message FindServerReverseProxyConfigResponse {
}
// 初始化Web设置
message InitServerWebRequest {
message FindAndInitServerWebRequest {
int64 serverId = 1;
}
message InitServerWebResponse {
int64 webId = 1;
message FindAndInitServerWebResponse {
bytes config = 1;
}

View File

@@ -0,0 +1,166 @@
package configutils
import "github.com/iwind/TeaGo/maps"
var UsualCharsets = []maps.Map{
{"charset": "utf-8", "name": "Universal Alphabet (UTF-8)"},
{"charset": "unicode", "name": "Unicode"},
{"name": "Chinese Simplified (GB2312)", "charset": "gb2312"},
{"charset": "big5", "name": "Chinese Traditional (Big5)"},
{"charset": "iso-8859-1", "name": "Western Alphabet"},
{"charset": "euc-kr", "name": "Korean (EUC)"},
{"charset": "shift-jis", "name": "Japanese (Shift-JIS)"},
{"charset": "us-ascii", "name": "US-ASCII"},
}
// 数据来自 https://webcheatsheet.com/html/character_sets_list.php
var BasicCharsets = []maps.Map{
{"name": "Chinese Traditional (Big5)", "charset": "big5"},
{"charset": "euc-kr", "name": "Korean (EUC)"},
{"charset": "iso-8859-1", "name": "Western Alphabet"},
{"charset": "iso-8859-2", "name": "Central European Alphabet (ISO)"},
{"charset": "iso-8859-3", "name": "Latin 3 Alphabet (ISO)"},
{"charset": "iso-8859-4", "name": "Baltic Alphabet (ISO)"},
{"charset": "iso-8859-5", "name": "Cyrillic Alphabet (ISO)"},
{"charset": "iso-8859-6", "name": "Arabic Alphabet (ISO)"},
{"charset": "iso-8859-7", "name": "Greek Alphabet (ISO)"},
{"charset": "iso-8859-8", "name": "Hebrew Alphabet (ISO)"},
{"charset": "koi8-r", "name": "Cyrillic Alphabet (KOI8-R)"},
{"charset": "shift-jis", "name": "Japanese (Shift-JIS)"},
{"name": "Japanese (EUC)", "charset": "x-euc"},
{"charset": "utf-8", "name": "Universal Alphabet (UTF-8)"},
{"charset": "windows-1250", "name": "Central European Alphabet (Windows)"},
{"charset": "windows-1251", "name": "Cyrillic Alphabet (Windows)"},
{"charset": "windows-1252", "name": "Western Alphabet (Windows)"},
{"charset": "windows-1253", "name": "Greek Alphabet (Windows)"},
{"charset": "windows-1254", "name": "Turkish Alphabet"},
{"charset": "windows-1255", "name": "Hebrew Alphabet (Windows)"},
{"charset": "windows-1256", "name": "Arabic Alphabet (Windows)"},
{"charset": "windows-1257", "name": "Baltic Alphabet (Windows)"},
{"charset": "windows-1258", "name": "Vietnamese Alphabet (Windows)"},
{"charset": "windows-874", "name": "Thai (Windows)"},
}
var AllCharsets = []maps.Map{
{"charset": "ASMO-708", "name": "Arabic (ASMO 708)"},
{"charset": "DOS-720", "name": "Arabic (DOS)"},
{"charset": "iso-8859-6", "name": "Arabic (ISO)"},
{"charset": "x-mac-arabic", "name": "Arabic (Mac)"},
{"charset": "windows-1256", "name": "Arabic (Windows)"},
{"charset": "ibm775", "name": "Baltic (DOS)"},
{"charset": "iso-8859-4", "name": "Baltic (ISO)"},
{"charset": "windows-1257", "name": "Baltic (Windows)"},
{"charset": "ibm852", "name": "Central European (DOS)"},
{"name": "Central European (ISO)", "charset": "iso-8859-2"},
{"charset": "x-mac-ce", "name": "Central European (Mac)"},
{"charset": "windows-1250", "name": "Central European (Windows)"},
{"name": "Chinese Simplified (EUC)", "charset": "EUC-CN"},
{"name": "Chinese Simplified (GB2312)", "charset": "gb2312"},
{"charset": "hz-gb-2312", "name": "Chinese Simplified (HZ)"},
{"charset": "x-mac-chinesesimp", "name": "Chinese Simplified (Mac)"},
{"charset": "big5", "name": "Chinese Traditional (Big5)"},
{"name": "Chinese Traditional (CNS)", "charset": "x-Chinese-CNS"},
{"charset": "x-Chinese-Eten", "name": "Chinese Traditional (Eten)"},
{"charset": "x-mac-chinesetrad", "name": "Chinese Traditional (Mac)"},
{"charset": "950", "name": "Chinese Traditional (Mac)"},
{"charset": "cp866", "name": "Cyrillic (DOS)"},
{"charset": "iso-8859-5", "name": "Cyrillic (ISO)"},
{"charset": "koi8-r", "name": "Cyrillic (KOI8-R)"},
{"charset": "koi8-u", "name": "Cyrillic (KOI8-U)"},
{"charset": "x-mac-cyrillic", "name": "Cyrillic (Mac)"},
{"charset": "windows-1251", "name": "Cyrillic (Windows)"},
{"charset": "x-Europa", "name": "Europa"},
{"charset": "x-IA5-German", "name": "German (IA5)"},
{"charset": "ibm737", "name": "Greek (DOS)"},
{"name": "Greek (ISO)", "charset": "iso-8859-7"},
{"name": "Greek (Mac)", "charset": "x-mac-greek"},
{"charset": "windows-1253", "name": "Greek (Windows)"},
{"charset": " ", "name": "Greek (Windows)"},
{"charset": "ibm869", "name": "Greek, Modern (DOS)"},
{"name": "Hebrew (DOS)", "charset": "DOS-862"},
{"charset": "iso-8859-8-i", "name": "Hebrew (ISO-Logical)"},
{"charset": "iso-8859-8", "name": "Hebrew (ISO-Visual)"},
{"charset": "x-mac-hebrew", "name": "Hebrew (Mac)"},
{"charset": "windows-1255", "name": "Hebrew (Windows)"},
{"charset": "x-EBCDIC-Arabic", "name": "IBM EBCDIC (Arabic)"},
{"charset": "x-EBCDIC-CyrillicRussian", "name": "IBM EBCDIC (Cyrillic Russian)"},
{"charset": "x-EBCDIC-CyrillicSerbianBulgarian", "name": "IBM EBCDIC (Cyrillic Serbian-Bulgarian)"},
{"charset": "x-EBCDIC-DenmarkNorway", "name": "IBM EBCDIC (Denmark-Norway)"},
{"charset": "x-ebcdic-denmarknorway-euro", "name": "IBM EBCDIC (Denmark-Norway-Euro)"},
{"charset": "x-EBCDIC-FinlandSweden", "name": "IBM EBCDIC (Finland-Sweden)"},
{"charset": "x-ebcdic-finlandsweden-euro", "name": "IBM EBCDIC (Finland-Sweden-Euro)"},
{"charset": "x-ebcdic-finlandsweden-euro", "name": "IBM EBCDIC (Finland-Sweden-Euro)"},
{"charset": "x-ebcdic-france-euro", "name": "IBM EBCDIC (France-Euro)"},
{"charset": "x-EBCDIC-Germany", "name": "IBM EBCDIC (Germany)"},
{"charset": "x-ebcdic-germany-euro", "name": "IBM EBCDIC (Germany-Euro)"},
{"charset": "x-EBCDIC-GreekModern", "name": "IBM EBCDIC (Greek Modern)"},
{"charset": "x-EBCDIC-Greek", "name": "IBM EBCDIC (Greek)"},
{"charset": "x-EBCDIC-Hebrew", "name": "IBM EBCDIC (Hebrew)"},
{"charset": "x-EBCDIC-Icelandic", "name": "IBM EBCDIC (Icelandic)"},
{"charset": "x-ebcdic-icelandic-euro", "name": "IBM EBCDIC (Icelandic-Euro)"},
{"name": "IBM EBCDIC (International-Euro)", "charset": "x-ebcdic-international-euro"},
{"charset": "x-EBCDIC-Italy", "name": "IBM EBCDIC (Italy)"},
{"charset": "x-ebcdic-italy-euro", "name": "IBM EBCDIC (Italy-Euro)"},
{"charset": "x-EBCDIC-JapaneseAndKana", "name": "IBM EBCDIC (Japanese and Japanese Katakana)"},
{"charset": "x-EBCDIC-JapaneseAndJapaneseLatin", "name": "IBM EBCDIC (Japanese and Japanese-Latin)"},
{"name": "IBM EBCDIC (Japanese and US-Canada)", "charset": "x-EBCDIC-JapaneseAndUSCanada"},
{"name": "IBM EBCDIC (Japanese katakana)", "charset": "x-EBCDIC-JapaneseKatakana"},
{"charset": "x-EBCDIC-KoreanAndKoreanExtended", "name": "IBM EBCDIC (Korean and Korean Extended)"},
{"charset": "x-EBCDIC-KoreanExtended", "name": "IBM EBCDIC (Korean Extended)"},
{"charset": "CP870", "name": "IBM EBCDIC (Multilingual Latin-2)"},
{"charset": "x-EBCDIC-SimplifiedChinese", "name": "IBM EBCDIC (Simplified Chinese)"},
{"charset": "X-EBCDIC-Spain", "name": "IBM EBCDIC (Spain)"},
{"charset": "x-ebcdic-spain-euro", "name": "IBM EBCDIC (Spain-Euro)"},
{"charset": "x-EBCDIC-Thai", "name": "IBM EBCDIC (Thai)"},
{"charset": "x-EBCDIC-TraditionalChinese", "name": "IBM EBCDIC (Traditional Chinese)"},
{"charset": "CP1026", "name": "IBM EBCDIC (Turkish Latin-5)"},
{"charset": "x-EBCDIC-Turkish", "name": "IBM EBCDIC (Turkish)"},
{"charset": "x-EBCDIC-UK", "name": "IBM EBCDIC (UK)"},
{"charset": "x-ebcdic-uk-euro", "name": "IBM EBCDIC (UK-Euro)"},
{"charset": "ebcdic-cp-us", "name": "IBM EBCDIC (US-Canada)"},
{"name": "IBM EBCDIC (US-Canada-Euro)", "charset": "x-ebcdic-cp-us-euro"},
{"charset": "ibm861", "name": "Icelandic (DOS)"},
{"charset": "x-mac-icelandic", "name": "Icelandic (Mac)"},
{"charset": "x-iscii-as", "name": "ISCII Assamese"},
{"charset": "x-iscii-be", "name": "ISCII Bengali"},
{"charset": "x-iscii-de", "name": "ISCII Devanagari"},
{"charset": "x-iscii-gu", "name": "ISCII Gujarathi"},
{"charset": "x-iscii-ka", "name": "ISCII Kannada"},
{"charset": "x-iscii-ma", "name": "ISCII Malayalam"},
{"charset": "x-iscii-or", "name": "ISCII Oriya"},
{"charset": "x-iscii-pa", "name": "ISCII Panjabi"},
{"charset": "x-iscii-ta", "name": "ISCII Tamil"},
{"charset": "x-iscii-te", "name": "ISCII Telugu"},
{"charset": "euc-jp", "name": "Japanese (EUC)"},
{"charset": "x-euc-jp", "name": "Japanese (EUC)"},
{"charset": "iso-2022-jp", "name": "Japanese (JIS)"},
{"charset": "iso-2022-jp", "name": "Japanese (JIS-Allow 1 byte Kana - SO/SI)"},
{"charset": "csISO2022JP", "name": "Japanese (JIS-Allow 1 byte Kana)"},
{"charset": "x-mac-japanese", "name": "Japanese (Mac)"},
{"charset": "shift_jis", "name": "Japanese (Shift-JIS)"},
{"charset": "ks_c_5601-1987", "name": "Korean"},
{"charset": "euc-kr", "name": "Korean (EUC)"},
{"charset": "iso-2022-kr", "name": "Korean (ISO)"},
{"charset": "Johab", "name": "Korean (Johab)"},
{"charset": "x-mac-korean", "name": "Korean (Mac)"},
{"charset": "iso-8859-3", "name": "Latin 3 (ISO)"},
{"charset": "iso-8859-15", "name": "Latin 9 (ISO)"},
{"charset": "x-IA5-Norwegian", "name": "Norwegian (IA5)"},
{"charset": "IBM437", "name": "OEM United States"},
{"charset": "x-IA5-Swedish", "name": "Swedish (IA5)"},
{"charset": "windows-874", "name": "Thai (Windows)"},
{"charset": "ibm857", "name": "Turkish (DOS)"}, {"charset": "iso-8859-9", "name": "Turkish (ISO)"},
{"charset": "x-mac-turkish", "name": "Turkish (Mac)"},
{"charset": "windows-1254", "name": "Turkish (Windows)"},
{"charset": "unicode", "name": "Unicode"},
{"charset": "unicodeFFFE", "name": "Unicode (Big-Endian)"},
{"charset": "utf-7", "name": "Unicode (UTF-7)"},
{"name": "Unicode (UTF-8)", "charset": "utf-8"},
{"charset": "us-ascii", "name": "US-ASCII"},
{"charset": "windows-1258", "name": "Vietnamese (Windows)"},
{"charset": "ibm850", "name": "Western European (DOS)"},
{"charset": "x-IA5", "name": "Western European (IA5)"},
{"charset": "iso-8859-1", "name": "Western European (ISO)"},
{"name": "Western European (Mac)", "charset": "macintosh"},
{"charset": "Windows-1252", "name": "Western European (Windows)"},
}

View File

@@ -0,0 +1,45 @@
package serverconfigs
// 特殊页面配置
// TODO 需要支持Header定义
// TODO 需要可以自定义文本
type HTTPPageConfig struct {
Id int64 `yaml:"id" json:"id"` // 页面ID
IsOn bool `yaml:"isOn" json:"isOn"` // 是否开启 TODO
Status []string `yaml:"status" json:"status"` // 响应支持40x, 50x, 3x2
URL string `yaml:"url" json:"url"` // URL
NewStatus int `yaml:"newStatus" json:"newStatus"` // 新状态码
statusList []*WildcardStatus
hasStatusList bool
}
// 获取新对象
func NewHTTPPageConfig() *HTTPPageConfig {
return &HTTPPageConfig{
IsOn: true,
}
}
// 校验
func (this *HTTPPageConfig) Init() error {
this.statusList = []*WildcardStatus{}
for _, s := range this.Status {
this.statusList = append(this.statusList, NewWildcardStatus(s))
}
this.hasStatusList = len(this.statusList) > 0
return nil
}
// 检查是否匹配
func (this *HTTPPageConfig) Match(status int) bool {
if !this.hasStatusList {
return false
}
for _, s := range this.statusList {
if s.Match(status) {
return true
}
}
return false
}

View File

@@ -0,0 +1,35 @@
package serverconfigs
import (
"github.com/iwind/TeaGo/assert"
"testing"
)
func TestPageConfig_Match(t *testing.T) {
a := assert.NewAssertion(t)
{
page := NewHTTPPageConfig()
page.Status = []string{"200"}
err := page.Init()
if err != nil {
t.Fatal(err)
}
a.IsTrue(page.Match(200))
a.IsFalse(page.Match(201))
}
{
page := NewHTTPPageConfig()
page.Status = []string{"4xx", "5xx"}
err := page.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(page.Match(200))
a.IsTrue(page.Match(401))
a.IsTrue(page.Match(404))
a.IsTrue(page.Match(500))
a.IsTrue(page.Match(505))
}
}

View File

@@ -0,0 +1,7 @@
package serverconfigs
// 跳转到HTTPS配置
// TODO 支持跳转的状态码选择
type HTTPRedirectToHTTPSConfig struct {
IsOn bool `yaml:"isOn" json:"isOn"`
}

View File

@@ -0,0 +1,18 @@
package serverconfigs
// 关闭页面配置
type HTTPShutdownConfig struct {
IsOn bool `yaml:"isOn" json:"isOn"`
URL string `yaml:"url" json:"url"`
Status int `yaml:"status" json:"status"`
}
// 获取新对象
func NewHTTPShutdownConfig() *HTTPShutdownConfig {
return &HTTPShutdownConfig{}
}
// 校验
func (this *HTTPShutdownConfig) Init() error {
return nil
}

View File

@@ -1,11 +1,19 @@
package serverconfigs
type HTTPWebConfig struct {
Id int64 `yaml:"id" json:"id"` // ID
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
Locations []*LocationConfig `yaml:"locations" json:"locations"` // 路径规则 TODO
Gzip *HTTPGzipConfig `yaml:"gzip" json:"gzip"` // Gzip配置
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
// 本地静态资源配置
Root string `yaml:"root" json:"root"` // 资源根目录 TODO
type HTTPWebConfig struct {
Id int64 `yaml:"id" json:"id"` // ID
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
Locations []*LocationConfig `yaml:"locations" json:"locations"` // 路径规则 TODO
Gzip *HTTPGzipConfig `yaml:"gzip" json:"gzip"` // Gzip配置
Charset string `yaml:"charset" json:"charset"` // 字符编码
Shutdown *HTTPShutdownConfig `yaml:"shutdown" json:"shutdown"` // 临时关闭配置
Pages []*HTTPPageConfig `yaml:"pages" json:"pages"` // 特殊页面配置
RedirectToHttps *HTTPRedirectToHTTPSConfig `yaml:"redirectToHttps" json:"redirectToHttps"` // 是否自动跳转到Https
Root string `yaml:"root" json:"root"` // 资源根目录 TODO
Indexes []string `yaml:"indexes" json:"indexes"` // 默认首页文件
MaxRequestBodySize string `yaml:"maxRequestBodySize" json:"maxRequestBodySize"` // 请求body最大尺寸
RequestHeaders *shared.HTTPHeaderPolicy `yaml:"requestHeaders" json:"requestHeaders"` // 请求Header
ResponseHeaders *shared.HTTPHeaderPolicy `yaml:"responseHeaders" json:"responseHeaders"` // 响应Header`
}

View File

@@ -0,0 +1,36 @@
package serverconfigs
import (
"fmt"
"github.com/iwind/TeaGo/types"
"regexp"
"strings"
)
// 可能含有x字母的状态码
type WildcardStatus struct {
StatusInt int
StatusRegexp *regexp.Regexp
}
// 获取新对象
func NewWildcardStatus(status string) *WildcardStatus {
status = regexp.MustCompile("[^0-9x]").ReplaceAllString(status, "")
if strings.Contains(status, "x") {
return &WildcardStatus{
StatusRegexp: regexp.MustCompile("^" + strings.Replace(status, "x", "\\d", -1) + "$"),
}
} else {
return &WildcardStatus{
StatusInt: types.Int(status),
}
}
}
// 判断匹配
func (this *WildcardStatus) Match(status int) bool {
if this.StatusRegexp != nil {
return this.StatusRegexp.MatchString(fmt.Sprintf("%d", status))
}
return this.StatusInt == status
}

View File

@@ -0,0 +1,31 @@
package serverconfigs
import (
"github.com/iwind/TeaGo/assert"
"testing"
)
func TestWildcardStatus_Match(t *testing.T) {
a := assert.NewAssertion(t)
{
s := NewWildcardStatus("123")
a.IsTrue(s.Match(123))
}
{
s := NewWildcardStatus("5x3")
a.IsTrue(s.Match(523))
a.IsTrue(s.Match(553))
}
{
s := NewWildcardStatus("5xx")
a.IsTrue(s.Match(523))
a.IsTrue(s.Match(553))
a.IsTrue(s.Match(500))
a.IsFalse(s.Match(5000))
a.IsFalse(s.Match(50))
a.IsFalse(s.Match(400))
}
}

View File

@@ -33,8 +33,8 @@ type OriginServerConfig struct {
RequestURI string `yaml:"requestURI" json:"requestURI"` // 转发后的请求URI TODO
Host string `yaml:"host" json:"host"` // 自定义主机名 TODO
RequestHeaders *shared.HTTPHeadersConfig `yaml:"requestHeaders" json:"requestHeaders"` // 请求Header设置 TODO
ResponseHeaders *shared.HTTPHeadersConfig `yaml:"responseHeaders" json:"responseHeaders"`
RequestHeaders *shared.HTTPHeaderPolicy `yaml:"requestHeaders" json:"requestHeaders"` // 请求Header设置 TODO
ResponseHeaders *shared.HTTPHeaderPolicy `yaml:"responseHeaders" json:"responseHeaders"`
// 健康检查URL目前支持
// - http|https 返回2xx-3xx认为成功

View File

@@ -8,7 +8,7 @@ var regexpNamedVariable = regexp.MustCompile("\\${[\\w.-]+}")
// 头部信息定义
type HTTPHeaderConfig struct {
Id int `yaml:"id" json:"id"` // ID
Id int64 `yaml:"id" json:"id"` // ID
IsOn bool `yaml:"isOn" json:"isOn"` // 是否开启
Name string `yaml:"name" json:"name"` // Name
Value string `yaml:"value" json:"value"` // Value

View File

@@ -1,22 +1,26 @@
package shared
// HeaderList定义
type HTTPHeadersConfig struct {
type HTTPHeaderPolicy struct {
Id int64 `yaml:"id" json:"id"`
IsOn bool `yaml:"isOn" json:"isOn"` // TODO
AddHeaders []*HTTPHeaderConfig `yaml:"addHeaders" json:"addHeaders"` // TODO
AddTrailers []*HTTPHeaderConfig `yaml:"addTrailers" json:"addTrailers"` // TODO
SetHeaders []*HTTPHeaderConfig `yaml:"setHeaders" json:"setHeaders"` // TODO
ReplaceHeaders []*HTTPHeaderConfig `yaml:"replaceHeaders" json:"replaceHeaders"` // TODO
ReplaceHeaders []*HTTPHeaderConfig `yaml:"replaceHeaders" json:"replaceHeaders"` // 替换Header内容 TODO
DeletedHeaders []string `yaml:"deleteHeaders" json:"deleteHeaders"` // 删除的Header TODO
Expires *HTTPExpireHeaderConfig `yaml:"expires" json:"expires"` // TODO
}
// 获取新对象
func NewHTTPHeaders() *HTTPHeadersConfig {
return &HTTPHeadersConfig{}
func NewHTTPHeaderPolicy() *HTTPHeaderPolicy {
return &HTTPHeaderPolicy{}
}
// 校验
func (this *HTTPHeadersConfig) Init() error {
func (this *HTTPHeaderPolicy) Init() error {
for _, h := range this.AddHeaders {
err := h.Init()
if err != nil {
@@ -49,6 +53,6 @@ func (this *HTTPHeadersConfig) Init() error {
}
// 判断是否为空
func (this *HTTPHeadersConfig) IsEmpty() bool {
func (this *HTTPHeaderPolicy) IsEmpty() bool {
return len(this.AddHeaders) == 0 && len(this.AddTrailers) == 0 && len(this.SetHeaders) == 0 && len(this.ReplaceHeaders) == 0 && this.Expires == nil
}

View File

@@ -5,7 +5,7 @@ import (
)
func TestHeaderList_FormatHeaders(t *testing.T) {
list := NewHTTPHeaders()
list := NewHTTPHeaderPolicy()
err := list.Init()
if err != nil {
t.Fatal(err)