Documentation ¶
Index ¶
- Variables
- 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 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 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 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 { // Protocol support `http`, `https`, `unix`(http server based on unix domain socket), default `http` Protocol string `env:""` // Addr listen addr, default `0.0.0.0`. if based on a unix socket, set Addr as unix socket file abs path Addr string `env:""` // Port listen port Port int `env:",opt,expose"` // Spec document rel path Spec string `env:",opt,copy"` // HealthCheck path HealthCheck string `env:",opt,healthCheck"` // Debug if enable debug mode 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.