transformer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidGrpcMethodName = jErrors.ConstError("gRPC method name is invalid")
)

Variables

This section is empty.

Functions

func GetRPCRequest

func GetRPCRequest(
	body []byte,
	requestDesc protoreflect.MessageDescriptor,
	params []Variable,
	httpBodyRule HTTPBodyRule,
) (*dynamicpb.Message, error)

func GetRPCRequestContext

func GetRPCRequestContext(request *http.Request) context.Context

func GetRPCResponse

func GetRPCResponse(responseDesc protoreflect.MessageDescriptor) *dynamicpb.Message

func SetRESTHeaders

func SetRESTHeaders(protoMajor int, headers http.Header, gRPCheader metadata.MD, gRPCTrailer metadata.MD)

func ValidateFieldPath

func ValidateFieldPath(desc protoreflect.MessageDescriptor, fieldPath []string) error

Types

type BodyRuleType

type BodyRuleType int
const (
	NoBodyRule BodyRuleType = iota
	MapRootRule
	FieldPathRule
)

type HTTPBodyRule

type HTTPBodyRule struct {
	RuleType  BodyRuleType
	FieldPath []string
}

func GetHTTPBodyRule

func GetHTTPBodyRule(rule string) HTTPBodyRule

type Variable

type Variable struct {
	FieldPath []string
	Value     string
}

Jump to

Keyboard shortcuts

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