package grpcutil
Import Path
google.golang.org/grpc/internal/grpcutil (on go.dev)
Dependency Relation
imports 8 packages, and imported by 4 packages
Involved Source Files
compressor.go
encode_duration.go
Package grpcutil provides utility functions used across the gRPC codebase.
metadata.go
method.go
regex.go
Package-Level Type Names (only one, which is unexported)
Package-Level Functions (total 10, in which 9 are exported)
ContentSubtype returns the content-subtype for the given content-type. The
given content-type must be a valid content-type that starts with
"application/grpc". A content-subtype will follow "application/grpc" after a
"+" or ";". See
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for
more details.
If contentType is not a valid content-type for gRPC, the boolean
will be false, otherwise true. If content-type == "application/grpc",
"application/grpc+", or "application/grpc;", the boolean will be true,
but no content-subtype will be returned.
contentType is assumed to be lowercase already.
ContentType builds full content type with the given sub-type.
contentSubtype is assumed to be lowercase
EncodeDuration encodes the duration to the format grpc-timeout header
accepts.
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
ExtraMetadata returns the incoming metadata in ctx if it exists. The
returned MD should not be modified. Writing to it may cause races.
Modification should be made to copies of the returned MD.
FullMatchWithRegex returns whether the full text matches the regex provided.
IsCompressorNameRegistered returns true when name is available in registry.
ParseMethod splits service and method from the input. It expects format
"/service/method".
RegisteredCompressors returns a string of registered compressor names
separated by comma.
WithExtraMetadata creates a new context with incoming md attached.
Package-Level Variables (only one, which is exported)
RegisteredCompressorNames holds names of the registered compressors.
Package-Level Constants (total 2, neither is exported)
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)