Source File
method.go
Belonging Package
google.golang.org/grpc/internal/grpcutil
package grpcutil
import (
)
func ( string) (, string, error) {
if !strings.HasPrefix(, "/") {
return "", "", errors.New("invalid method name: should start with /")
}
= [1:]
:= strings.LastIndex(, "/")
if < 0 {
return "", "", errors.New("invalid method name: suffix /method is missing")
}
return [:], [+1:], nil
}
const baseContentType = "application/grpc"
func ( string) (string, bool) {
if == baseContentType {
return "", true
}
if !strings.HasPrefix(, baseContentType) {
return "", false
switch [len(baseContentType)] {
return [len(baseContentType)+1:], true
default:
return "", false
}
}
func ( string) string {
if == "" {
return baseContentType
}
return baseContentType + "+" +
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |