package utilities
import "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
Package utilities provides members for internal use in grpc-gateway.
Index ¶
- Constants
- func IOReaderFactory(r io.Reader) (func() io.Reader, error)
- type DoubleArray
- func NewDoubleArray(seqs [][]string) *DoubleArray
- func (da *DoubleArray) HasCommonPrefix(seq []string) bool
- type OpCode
- type StringArrayFlags
Constants ¶
const ( // OpNop does nothing OpNop = OpCode(iota) // OpPush pushes a component to stack OpPush // OpLitPush pushes a component to stack if it matches to the literal OpLitPush // OpPushM concatenates the remaining components and pushes it to stack OpPushM // OpConcatN pops N items from stack, concatenates them and pushes it back to stack OpConcatN // OpCapture pops an item and binds it to the variable OpCapture // OpEnd is the least positive invalid opcode. OpEnd )
These constants are the valid values of OpCode.
Functions ¶
func IOReaderFactory ¶
IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins at the start of the stream
Types ¶
type DoubleArray ¶
type DoubleArray struct { // Encoding keeps an encoding from string to int Encoding map[string]int // Base is the base array of Double Array Base []int // Check is the check array of Double Array Check []int }
DoubleArray is a Double Array implementation of trie on sequences of strings.
func NewDoubleArray ¶
func NewDoubleArray(seqs [][]string) *DoubleArray
NewDoubleArray builds a DoubleArray from a set of sequences of strings.
func (*DoubleArray) HasCommonPrefix ¶
func (da *DoubleArray) HasCommonPrefix(seq []string) bool
HasCommonPrefix determines if any sequence in the DoubleArray is a prefix of the given sequence.
type OpCode ¶
type OpCode int
OpCode is an opcode of compiled path patterns.
type StringArrayFlags ¶
type StringArrayFlags []string
StringArrayFlags is a wrapper of `[]string` to provider an interface for `flag.Var`
func StringArrayFlag ¶
func StringArrayFlag(f flagInterface, name string, usage string) *StringArrayFlags
StringArrayFlag defines a flag with the specified name and usage string. The return value is the address of a `StringArrayFlags` variable that stores the repeated values of the flag.
func (*StringArrayFlags) Set ¶
func (i *StringArrayFlags) Set(value string) error
Set appends a value to `StringArrayFlags`
func (*StringArrayFlags) String ¶
func (i *StringArrayFlags) String() string
String returns a string representation of `StringArrayFlags`
Source Files ¶
doc.go pattern.go readerfactory.go string_array_flag.go trie.go
- Version
- v2.26.1 (latest)
- Published
- Feb 7, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 6 days ago –
Tools for package owners.