Documentation
¶
Index ¶
- Constants
- func ClearStats(r *http.Request)
- func ErrorCouldNotLoadArgs(w http.ResponseWriter)
- func ErrorCouldNotReply(w http.ResponseWriter)
- func ErrorFuncNotFound(w http.ResponseWriter)
- func ErrorMethodNotAllowed(w http.ResponseWriter)
- func ErrorReply(err error) any
- func GetCalledFunc(r *http.Request, endPoint string) string
- func InstrumentedService(middleware http.HandlerFunc, handleStats GoRPCCallStatsHandlerFun) http.HandlerFuncdeprecated
- func LoadArgs(args any, callStats *CallStats, r *http.Request) error
- func MustRegisterUnionExt(v ...any)
- func NewMSGPackDecoderBytes(b []byte) *codec.Decoder
- func NewMSGPackEncoderBytes(b *[]byte) *codec.Encoder
- func NoopMonitor(w http.ResponseWriter, r *http.Request, args, rets []any, stats *CallStats)
- func RegisterUnionExt(v ...any) error
- func Reply(response []any, stats *CallStats, r *http.Request, w http.ResponseWriter) error
- func RequestWithStatsContext(r *http.Request) *http.Request
- func SetDefaultHttpClientFactory(factory HttpClientFactory)
- func SetJSONExt(rt any, tag uint64, ext codec.InterfaceExt) error
- func SetMSGPackExt(rt any, tag uint64, ext codec.BytesExt) error
- type CallStats
- type Client
- type ClientEncoding
- type ClientError
- type Error
- type GoRPCCallStatsHandlerFun
- type HTTPError
- type HttpClientFactory
- type MonitorFn
- type ResponseWriter
- type UnionExt
Constants ¶
View Source
const ( EncodingMsgpack = ClientEncoding(0) EncodingJson = ClientEncoding(1) )
View Source
const (
HeaderServiceToService = "X-Foomo-S2s"
)
Variables ¶
This section is empty.
Functions ¶
func ClearStats ¶
func ErrorCouldNotLoadArgs ¶
func ErrorCouldNotLoadArgs(w http.ResponseWriter)
func ErrorCouldNotReply ¶
func ErrorCouldNotReply(w http.ResponseWriter)
func ErrorFuncNotFound ¶
func ErrorFuncNotFound(w http.ResponseWriter)
func ErrorMethodNotAllowed ¶
func ErrorMethodNotAllowed(w http.ResponseWriter)
func ErrorReply ¶ added in v2.14.0
ErrorReply wraps an error return value so Reply can detect it at runtime. Used by generated proxy code for methods whose last return type is the error interface.
func InstrumentedService
deprecated
func InstrumentedService(middleware http.HandlerFunc, handleStats GoRPCCallStatsHandlerFun) http.HandlerFunc
Deprecated: will be removed
func MustRegisterUnionExt ¶
func MustRegisterUnionExt(v ...any)
func NewMSGPackDecoderBytes ¶
func NewMSGPackEncoderBytes ¶
func NoopMonitor ¶
func RegisterUnionExt ¶
func Reply ¶
Reply although this is a public method - do not call it, it will be called by generated code
func SetDefaultHttpClientFactory ¶
func SetDefaultHttpClientFactory(factory HttpClientFactory)
func SetJSONExt ¶
func SetJSONExt(rt any, tag uint64, ext codec.InterfaceExt) error
Types ¶
type CallStats ¶
type Client ¶
type Client interface {
Call(ctx context.Context, url string, endpoint string, method string, args []any, reply []any) (err error)
SetClientEncoding(encoding ClientEncoding)
SetTransportHttpClient(client *http.Client)
SetDefaultHeaders(headers http.Header)
}
func NewClientWithHttpClient ¶
type ClientEncoding ¶
type ClientEncoding int
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
func NewClientError ¶
func NewClientError(err error) *ClientError
type Error ¶
type GoRPCCallStatsHandlerFun ¶
type GoRPCCallStatsHandlerFun func(stats *CallStats)
type HTTPError ¶
func NewHTTPError ¶
type HttpClientFactory ¶
type MonitorFn ¶
var Monitor MonitorFn = NoopMonitor
type ResponseWriter ¶
type ResponseWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
func (*ResponseWriter) Status ¶
func (r *ResponseWriter) Status() int
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(status int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.