Documentation ¶
Index ¶
- Variables
- func NewLogRoundTripper(logger *logrus.Entry) func(http.RoundTripper) http.RoundTripper
- func NewRequest(method string, path string) *request
- func OmitAuthorization(u *url.URL) string
- func RegisterChecker(k string, chk LivenessChecker)
- func RegisterCheckerBy(vs ...interface{})
- func ResetRegistered()
- func TraceLogHandler(name string) func(handler http.Handler) http.Handler
- func TraceLogHandlerWithLogger(logger *logrus.Entry, name string) func(handler http.Handler) http.Handler
- func WithContextCompose(contexts ...contextx.WithContext) contextx.WithContext
- func WithMiddlewares(ms ...httptransport.HttpMiddleware)
- type ClientEndpoint
- type Liveness
- type LivenessChecker
- type LivenessCheckers
- type LogRoundTripper
- type LoggerResponseWriter
- type Middleware
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var LivenessRouter = kit.NewRouter(&Liveness{})
View Source
var (
RTypeLivenessChecker = reflect.TypeOf((*LivenessChecker)(nil)).Elem()
)
Functions ¶
func NewLogRoundTripper ¶
func NewLogRoundTripper(logger *logrus.Entry) func(http.RoundTripper) http.RoundTripper
func NewRequest ¶
func OmitAuthorization ¶
func RegisterChecker ¶
func RegisterChecker(k string, chk LivenessChecker)
func RegisterCheckerBy ¶
func RegisterCheckerBy(vs ...interface{})
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 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.