Documentation ¶
Index ¶
- Variables
- func AuthzGuardian(srv authz.Service, requirement authz.RequirementList, ...) http.Handler
- func ClientIP(ctx context.Context) string
- func ClientUserAgent(ctx context.Context) string
- func HandleBlobs(basePath string, cfg blob.Config, srv *khttp.Server, factory blob.Factory)
- func HandlerWrap[TRet any](resEncoder khttp.EncodeResponseFunc, handler HandlerFunc[TRet]) http.HandlerFunc
- func Host(ctx context.Context) string
- func IsAjax(ctx context.Context) bool
- func IsSecure(ctx context.Context) bool
- func IsWebsocket(ctx context.Context) bool
- func MiddlewareConvert(errEncoder khttp.EncodeErrorFunc, m ...middleware.Middleware) func(handler http.Handler) http.Handler
- func NewRegistrar(services *conf.Services) (registry.Registrar, error)
- func NewWebMultiTenancyOption(opt *conf.AppConfig) *shttp.WebMultiTenancyOption
- func PatchGrpcOpts(l log.Logger, opts []grpc.ServerOption, name string, services *conf.Services) []grpc.ServerOption
- func PatchHttpOpts(l log.Logger, opts []khttp.ServerOption, name string, services *conf.Services, ...) []khttp.ServerOption
- func Recovery() middleware.Middleware
- func ResolveHttpRequest(ctx context.Context) (*http.Request, bool)
- func Saas(hmtOpt *shttp.WebMultiTenancyOption, ts saas.TenantStore, ...) middleware.Middleware
- type GrpcServiceRegister
- type GrpcServiceRegisterFunc
- type Handler
- type HandlerFunc
- type HttpServiceRegister
- type HttpServiceRegisterFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReqDecode http.DecodeRequestFunc = http.DefaultRequestDecoder ResEncoder http.EncodeResponseFunc = http.DefaultResponseEncoder ErrEncoder http.EncodeErrorFunc = http.DefaultErrorEncoder )
View Source
var DefaultProviderSet = wire.NewSet(wire.Value(ReqDecode), wire.Value(ResEncoder), wire.Value(ErrEncoder), NewRegistrar)
Functions ¶
func AuthzGuardian ¶
func AuthzGuardian(srv authz.Service, requirement authz.RequirementList, encoder khttp.EncodeErrorFunc, handler http.Handler) http.Handler
AuthzGuardian guard http.Handler with authz
func ClientUserAgent ¶
func HandleBlobs ¶
func HandlerWrap ¶
func HandlerWrap[TRet any](resEncoder khttp.EncodeResponseFunc, handler HandlerFunc[TRet]) http.HandlerFunc
func IsWebsocket ¶
func MiddlewareConvert ¶
func MiddlewareConvert(errEncoder khttp.EncodeErrorFunc, m ...middleware.Middleware) func(handler http.Handler) http.Handler
MiddlewareConvert convert kratos middleware into standard http middleware
func NewWebMultiTenancyOption ¶
func NewWebMultiTenancyOption(opt *conf.AppConfig) *shttp.WebMultiTenancyOption
func PatchGrpcOpts ¶
func PatchGrpcOpts(l log.Logger, opts []grpc.ServerOption, name string, services *conf.Services) []grpc.ServerOption
PatchGrpcOpts Patch grpc options with given service name and configs
func PatchHttpOpts ¶
func PatchHttpOpts(l log.Logger, opts []khttp.ServerOption, name string, services *conf.Services, sCfg *conf.Security, reqDecoder khttp.DecodeRequestFunc, resEncoder khttp.EncodeResponseFunc, errEncoder khttp.EncodeErrorFunc, f ...khttp.FilterFunc) []khttp.ServerOption
PatchHttpOpts Patch khttp options with given service name and configs. f use global filters
func Saas ¶
func Saas(hmtOpt *shttp.WebMultiTenancyOption, ts saas.TenantStore, trustedContextValidator api.TrustedContextValidator, options ...saas.ResolveOption) middleware.Middleware
Types ¶
type GrpcServiceRegister ¶
type GrpcServiceRegister interface {
Register(server *grpc.Server, middleware ...middleware.Middleware)
}
GrpcServiceRegister register grpc handler into grpc server
func ChainGrpcServiceRegister ¶
func ChainGrpcServiceRegister(r ...GrpcServiceRegister) GrpcServiceRegister
type GrpcServiceRegisterFunc ¶
type GrpcServiceRegisterFunc func(server *grpc.Server, middleware ...middleware.Middleware)
func (GrpcServiceRegisterFunc) Register ¶
func (f GrpcServiceRegisterFunc) Register(server *grpc.Server, middleware ...middleware.Middleware)
type HandlerFunc ¶
type HttpServiceRegister ¶
type HttpServiceRegister interface {
Register(server *khttp.Server, middleware ...middleware.Middleware)
}
HttpServiceRegister register http handler into http server
func ChainHttpServiceRegister ¶
func ChainHttpServiceRegister(r ...HttpServiceRegister) HttpServiceRegister
type HttpServiceRegisterFunc ¶
type HttpServiceRegisterFunc func(server *khttp.Server, middleware ...middleware.Middleware)
func (HttpServiceRegisterFunc) Register ¶
func (f HttpServiceRegisterFunc) Register(server *khttp.Server, middleware ...middleware.Middleware)
Click to show internal directories.
Click to hide internal directories.