Documentation ¶
Index ¶
- Variables
- func NewLogRoundTripper() func(http.RoundTripper) http.RoundTripper
- func NewRequest(method string, path string) *request
- func OmitAuthorization(u *url.URL) string
- func RegisterCheckerBy(vs ...interface{})
- func RegisterEnvRouters(r *kit.Router)
- func ResetRegistered()
- func TraceLogHandler(tr trace.Tracer) func(http.Handler) http.Handler
- func WithContextCompose(contexts ...contextx.WithContext) contextx.WithContext
- func WithMiddlewares(ms ...httptransport.HttpMiddleware)
- type ClientEndpoint
- type EnvQuery
- type EnvSet
- type Liveness
- type LivenessChecker
- type LivenessCheckers
- type LogRoundTripper
- type LoggerResponseWriter
- type Middleware
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnvQueryRouter = kit.NewRouter(&EnvQuery{}) EnvSetRouter = kit.NewRouter(&EnvSet{}) )
View Source
var LivenessRouter = kit.NewRouter(&Liveness{})
View Source
var (
RTypeLivenessChecker = reflect.TypeOf((*LivenessChecker)(nil)).Elem()
)
Functions ¶
func NewLogRoundTripper ¶
func NewLogRoundTripper() func(http.RoundTripper) http.RoundTripper
func NewRequest ¶
func OmitAuthorization ¶
func RegisterCheckerBy ¶
func RegisterCheckerBy(vs ...interface{})
func RegisterEnvRouters ¶ added in v1.1.0
func ResetRegistered ¶
func ResetRegistered()
func WithContextCompose ¶
func WithContextCompose(contexts ...contextx.WithContext) contextx.WithContext
func WithMiddlewares ¶
func WithMiddlewares(ms ...httptransport.HttpMiddleware)
WithMiddlewares for custom
Types ¶
type ClientEndpoint ¶
type ClientEndpoint struct { Endpoint types.Endpoint `env:""` Timeout time.Duration client.Client `env:"-"` }
func (*ClientEndpoint) Init ¶
func (c *ClientEndpoint) Init()
func (*ClientEndpoint) LivenessCheck ¶
func (c *ClientEndpoint) LivenessCheck() map[string]string
func (*ClientEndpoint) SetDefault ¶
func (c *ClientEndpoint) SetDefault()
type EnvSet ¶ added in v1.1.0
type EnvSet struct { httpx.MethodPost K string `in:"query" name:"key"` V string `in:"query,omitempty" name:"key"` }
type LivenessChecker ¶
type LivenessCheckers ¶
type LivenessCheckers map[string]LivenessChecker
func (LivenessCheckers) Statuses ¶
func (cs LivenessCheckers) Statuses() map[string]string
type LogRoundTripper ¶
type LogRoundTripper struct {
// contains filtered or unexported fields
}
type LoggerResponseWriter ¶
type LoggerResponseWriter struct { http.ResponseWriter http.Hijacker http.Flusher // contains filtered or unexported fields }
func NewLoggerResponseWriter ¶
func NewLoggerResponseWriter(rw http.ResponseWriter) *LoggerResponseWriter
func (*LoggerResponseWriter) Header ¶
func (rw *LoggerResponseWriter) Header() http.Header
func (*LoggerResponseWriter) Write ¶
func (rw *LoggerResponseWriter) Write(data []byte) (int, error)
func (*LoggerResponseWriter) WriteHeader ¶
func (rw *LoggerResponseWriter) WriteHeader(sc int)
type Middleware ¶
func NewContextInjectorMw ¶
func NewContextInjectorMw(ctx contextx.WithContext) Middleware
type Server ¶
type Server struct { Port int `env:",opt,expose"` Spec string `env:",opt,copy"` HealthCheck string `env:",opt,healthCheck"` Debug *bool `env:""` // contains filtered or unexported fields }
func (*Server) LivenessCheck ¶
func (*Server) SetDefault ¶
func (s *Server) SetDefault()
func (Server) WithContextInjector ¶
func (s Server) WithContextInjector(injector contextx.WithContext) *Server
Source Files ¶
Click to show internal directories.
Click to hide internal directories.