syntax = "proto3";
option go_package = "./pb";

package pb;

import "models/rpc_messages.proto";

// HTTP Header管理服务
service HTTPHeaderService {
	// 创建Header
	rpc createHTTPHeader (CreateHTTPHeaderRequest) returns (CreateHTTPHeaderResponse);

	// 修改Header
	rpc updateHTTPHeader (UpdateHTTPHeaderRequest) returns (RPCSuccess);

	// 查找配置
	rpc findEnabledHTTPHeaderConfig (FindEnabledHTTPHeaderConfigRequest) returns (FindEnabledHTTPHeaderConfigResponse);
}

// 创建Header
message CreateHTTPHeaderRequest {
	string name = 1;
	string value = 2;
	repeated int32 status = 3;
	bool disableRedirect = 4;
	bool shouldAppend = 5;
	bool shouldReplace = 6;
	bytes replaceValuesJSON = 7;
	repeated string methods = 8;
	repeated string domains = 9;
}

message CreateHTTPHeaderResponse {
	int64 headerId = 1;
}

// 修改Header
message UpdateHTTPHeaderRequest {
	int64 headerId = 1;
	string name = 2;
	string value = 3;
	repeated int32 status = 4;
	bool disableRedirect = 5;
	bool shouldAppend = 6;
	bool shouldReplace = 7;
	bytes replaceValuesJSON = 8;
	repeated string methods = 9;
	repeated string domains = 10;
}

// 查找配置
message FindEnabledHTTPHeaderConfigRequest {
	int64 headerId = 1;
}

message FindEnabledHTTPHeaderConfigResponse {
	bytes headerJSON = 1;
}