gatewayutils

package
v2.0.0-beta.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateFieldFromPath

func PopulateFieldFromPath(msg proto.Message, fieldPathString, value string) error

PopulateFieldFromPath sets a value in a nested Protobuf structure.

func PopulateQueryParameters

func PopulateQueryParameters(msg proto.Message, values url.Values, filter *DoubleArray) error

PopulateQueryParameters parses query parameters into "msg" using current query parser

Types

type DefaultQueryParser

type DefaultQueryParser struct{}

DefaultQueryParser is a QueryParameterParser which implements the default query parameters parsing behavior.

See https://github.com/grpc-ecosystem/grpc-gateway/issues/2632 for more context.

func (*DefaultQueryParser) Parse

func (*DefaultQueryParser) Parse(msg proto.Message, values url.Values, filter *DoubleArray) error

Parse populates "values" into "msg". A value is ignored if its key starts with one of the elements in "filter".

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 QueryParameterParser

type QueryParameterParser interface {
	Parse(msg proto.Message, values url.Values, filter *DoubleArray) error
}

QueryParameterParser defines interface for all query parameter parsers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL