|
| 1 | +package v2 |
| 2 | + |
| 3 | +import ( |
| 4 | + "time" |
| 5 | + |
| 6 | + gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" |
| 7 | +) |
| 8 | + |
| 9 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | +// you may not use this file except in compliance with the License. |
| 11 | +// You may obtain a copy of the License at |
| 12 | +// |
| 13 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | +// |
| 15 | +// Unless required by applicable law or agreed to in writing, software |
| 16 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | +// See the License for the specific language governing permissions and |
| 19 | +// limitations under the License. |
| 20 | + |
| 21 | +type ( |
| 22 | + // ApisixRouteConditionType is a type of condition for a route. |
| 23 | + ApisixRouteConditionType = gatewayv1.RouteConditionType |
| 24 | + // ApisixRouteConditionReason is a reason for a route condition. |
| 25 | + ApisixRouteConditionReason = gatewayv1.RouteConditionReason |
| 26 | +) |
| 27 | + |
| 28 | +const ( |
| 29 | + ApisixRouteConditionTypeAccepted ApisixRouteConditionType = gatewayv1.RouteConditionAccepted |
| 30 | + ApisixRouteConditionReasonAccepted ApisixRouteConditionReason = gatewayv1.RouteReasonAccepted |
| 31 | + ApisixRouteConditionReasonInvalidHTTP ApisixRouteConditionReason = "InvalidHTTP" |
| 32 | +) |
| 33 | + |
| 34 | +const ( |
| 35 | + // DefaultUpstreamTimeout represents the default connect, |
| 36 | + // read and send timeout (in seconds) with upstreams. |
| 37 | + DefaultUpstreamTimeout = 60 * time.Second |
| 38 | +) |
| 39 | + |
| 40 | +const ( |
| 41 | + // OpEqual means the equal ("==") operator in nginxVars. |
| 42 | + OpEqual = "Equal" |
| 43 | + // OpNotEqual means the not equal ("~=") operator in nginxVars. |
| 44 | + OpNotEqual = "NotEqual" |
| 45 | + // OpGreaterThan means the greater than (">") operator in nginxVars. |
| 46 | + OpGreaterThan = "GreaterThan" |
| 47 | + // OpGreaterThanEqual means the greater than (">=") operator in nginxVars. |
| 48 | + OpGreaterThanEqual = "GreaterThanEqual" |
| 49 | + // OpLessThan means the less than ("<") operator in nginxVars. |
| 50 | + OpLessThan = "LessThan" |
| 51 | + // OpLessThanEqual means the less than equal ("<=") operator in nginxVars. |
| 52 | + OpLessThanEqual = "LessThanEqual" |
| 53 | + // OpRegexMatch means the regex match ("~~") operator in nginxVars. |
| 54 | + OpRegexMatch = "RegexMatch" |
| 55 | + // OpRegexNotMatch means the regex not match ("!~~") operator in nginxVars. |
| 56 | + OpRegexNotMatch = "RegexNotMatch" |
| 57 | + // OpRegexMatchCaseInsensitive means the regex match "~*" (case insensitive mode) operator in nginxVars. |
| 58 | + OpRegexMatchCaseInsensitive = "RegexMatchCaseInsensitive" |
| 59 | + // OpRegexNotMatchCaseInsensitive means the regex not match "!~*" (case insensitive mode) operator in nginxVars. |
| 60 | + OpRegexNotMatchCaseInsensitive = "RegexNotMatchCaseInsensitive" |
| 61 | + // OpIn means the in operator ("in") in nginxVars. |
| 62 | + OpIn = "In" |
| 63 | + // OpNotIn means the not in operator ("not_in") in nginxVars. |
| 64 | + OpNotIn = "NotIn" |
| 65 | + |
| 66 | + // ScopeQuery means the route match expression subject is in the querystring. |
| 67 | + ScopeQuery = "Query" |
| 68 | + // ScopeHeader means the route match expression subject is in request headers. |
| 69 | + ScopeHeader = "Header" |
| 70 | + // ScopePath means the route match expression subject is the uri path. |
| 71 | + ScopePath = "Path" |
| 72 | + // ScopeCookie means the route match expression subject is in cookie. |
| 73 | + ScopeCookie = "Cookie" |
| 74 | + // ScopeVariable means the route match expression subject is in variable. |
| 75 | + ScopeVariable = "Variable" |
| 76 | +) |
0 commit comments