Documentation ¶
Index ¶
- Variables
- func IsEnabled(cfg *Config) bool
- func NewClient(opts ...ClientOption) *http.Client
- func NewRoundTripper(opts ...ClientOption) http.RoundTripper
- func RegisterMetrics(cfg *metrics.Config, mux *http.ServeMux)
- type ClientOption
- func WithClientBreaker() ClientOption
- func WithClientCompression() ClientOption
- func WithClientH2C() ClientOption
- func WithClientLogger(logger *zap.Logger) ClientOption
- func WithClientMetrics(meter metric.Meter) ClientOption
- func WithClientRetry(cfg *sr.Config) ClientOption
- func WithClientRoundTripper(rt http.RoundTripper) ClientOption
- func WithClientTLS(sec *ct.Config) (ClientOption, error)
- func WithClientTimeout(timeout string) ClientOption
- func WithClientTokenGenerator(gen token.Generator) ClientOption
- func WithClientTracer(tracer trace.Tracer) ClientOption
- func WithClientUserAgent(userAgent env.UserAgent) ClientOption
- type Config
- type Server
- type ServerParams
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(http.NewServeMux), fx.Provide(content.NewContent), fx.Provide(mvc.NewViews), fx.Provide(mvc.NewRouter), fx.Invoke(rpc.Register), fx.Provide(NewServer), fx.Invoke(RegisterMetrics), )
Module for fx.
Functions ¶
func NewRoundTripper ¶ added in v1.105.0
func NewRoundTripper(opts ...ClientOption) http.RoundTripper
NewRoundTripper for HTTP.
Types ¶
type ClientOption ¶ added in v1.50.0
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption for HTTP.
func WithClientBreaker ¶ added in v1.50.0
func WithClientBreaker() ClientOption
WithClientBreaker for HTTP.
func WithClientCompression ¶ added in v1.224.0
func WithClientCompression() ClientOption
WithClientBreaker for HTTP.
func WithClientLogger ¶ added in v1.52.0
func WithClientLogger(logger *zap.Logger) ClientOption
WithClientLogger for HTTP.
func WithClientMetrics ¶ added in v1.65.0
func WithClientMetrics(meter metric.Meter) ClientOption
WithClientMetrics for HTTP.
func WithClientRetry ¶ added in v1.50.0
func WithClientRetry(cfg *sr.Config) ClientOption
WithClientRetry for HTTP.
func WithClientRoundTripper ¶ added in v1.50.0
func WithClientRoundTripper(rt http.RoundTripper) ClientOption
WithClientRoundTripper for HTTP.
func WithClientTLS ¶ added in v1.180.0
func WithClientTLS(sec *ct.Config) (ClientOption, error)
WithClientTLS for HTTP.
func WithClientTimeout ¶ added in v1.201.0
func WithClientTimeout(timeout string) ClientOption
WithClientTimeout for HTTP.
func WithClientTokenGenerator ¶ added in v1.204.0
func WithClientTokenGenerator(gen token.Generator) ClientOption
WithClientTokenGenerator for HTTP.
func WithClientTracer ¶ added in v1.52.0
func WithClientTracer(tracer trace.Tracer) ClientOption
WithClientTracer for HTTP.
func WithClientUserAgent ¶ added in v1.121.0
func WithClientUserAgent(userAgent env.UserAgent) ClientOption
WithUserAgent for HTTP.
type ServerParams ¶ added in v1.52.0
type ServerParams struct { fx.In Shutdowner fx.Shutdowner Mux *http.ServeMux Config *Config Logger *zap.Logger Tracer trace.Tracer Meter metric.Meter UserAgent env.UserAgent Version env.Version Limiter limiter.Store `optional:"true"` Key lm.KeyFunc `optional:"true"` Verifier token.Verifier `optional:"true"` Handlers []negroni.Handler `optional:"true"` }
ServerParams for HTTP.
Click to show internal directories.
Click to hide internal directories.