Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeGrpcPayload(data []byte) ([]byte, error)
- func EncodeGrpcPayload(payload []byte) []byte
- func VerboseFromContext(ctx context.Context) bool
- func WithProtocol(ctx context.Context, protocol HttpProtocol) context.Context
- func WithVerbose(ctx context.Context) context.Context
- type DialOption
- type Fetcher
- type HttpProtocol
- type VerboseLogger
Constants ¶
View Source
const (
ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
)
Variables ¶
View Source
var (
ErrHTTP2Unsupported = errors.New("unsupported protocol http2")
)
Functions ¶
func DecodeGrpcPayload ¶
func EncodeGrpcPayload ¶
func VerboseFromContext ¶
func WithProtocol ¶
func WithProtocol(ctx context.Context, protocol HttpProtocol) context.Context
Types ¶
type DialOption ¶
type DialOption func(*dialOptions)
func WithConn ¶
func WithConn(conn net.Conn) DialOption
func WithTLS ¶
func WithTLS() DialOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) DialOption
type Fetcher ¶
type Fetcher interface { Do(context.Context, *http.Request) (*http.Response, error) CallGRPC(ctx context.Context, serviceURL *url.URL, req, res proto.Message) error Close() error }
func NewFetcher ¶
func NewFetcher() Fetcher
type HttpProtocol ¶
type HttpProtocol uint8
const ( Unknown HttpProtocol = iota HTTP2 HTTP1 HTTP10 HTTP11 )
func ProtocolFromContext ¶
func ProtocolFromContext(ctx context.Context) HttpProtocol
type VerboseLogger ¶
Click to show internal directories.
Click to hide internal directories.