github.com/erda-project/erda-infra@v1.0.10-0.20240327085753-f3a249292aeb/pkg/transport/http/utilities/pattern.go (about) 1 // Copyright (c) 2021 Terminus, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Reference: https://github.com/grpc-ecosystem/grpc-gateway/blob/v2.3.0/utilities/pattern.go 16 17 package utilities 18 19 // An OpCode is a opcode of compiled path patterns. 20 type OpCode int 21 22 // These constants are the valid values of OpCode. 23 const ( 24 // OpNop does nothing 25 OpNop = OpCode(iota) 26 // OpPush pushes a component to stack 27 OpPush 28 // OpLitPush pushes a component to stack if it matches to the literal 29 OpLitPush 30 // OpPushM concatenates the remaining components and pushes it to stack 31 OpPushM 32 // OpConcatN pops N items from stack, concatenates them and pushes it back to stack 33 OpConcatN 34 // OpCapture pops an item and binds it to the variable 35 OpCapture 36 // OpEnd is the least positive invalid opcode. 37 OpEnd 38 )