Documentation ¶
Index ¶
- func GetConfigFromEnv() (*config, error)
- func GetDiFromCtx[T DI](ctx context.Context) T
- func GetDiFromGin[T DI](c *gin.Context) T
- func GinMiddleHandler(di DI) gin.HandlerFunc
- func GrpcStreamInterceptor(di DI) grpc.StreamServerInterceptor
- func GrpcUnaryInterceptor(di DI) grpc.UnaryServerInterceptor
- func IniConfByEnv(path, env, fname string, di DI) error
- func InitConf(path, fname string, di DI) error
- func InitConfByByte(b []byte, di DI) error
- func InitConfByCfg(cfg *config, di DI) error
- func InitConfByFile(f string, di DI) error
- func InitConfByUri(uri string, di DI) error
- func InitServiceDIByCfg(cfg *config, di ServiceDI) error
- func SetDiToCtx[T DI](ctx context.Context, di T) context.Context
- func SetDiToGin[T DI](c *gin.Context, di T)
- type CommonServiceDI
- type DI
- type ServiceDI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigFromEnv ¶
func GetConfigFromEnv() (*config, error)
func GetDiFromCtx ¶
func GetDiFromGin ¶
func GinMiddleHandler ¶
func GinMiddleHandler(di DI) gin.HandlerFunc
func GrpcStreamInterceptor ¶
func GrpcStreamInterceptor(di DI) grpc.StreamServerInterceptor
func GrpcUnaryInterceptor ¶
func GrpcUnaryInterceptor(di DI) grpc.UnaryServerInterceptor
func InitConfByByte ¶
func InitConfByCfg ¶
func InitConfByFile ¶
func InitConfByUri ¶
func InitServiceDIByCfg ¶
func SetDiToGin ¶
Types ¶
type CommonServiceDI ¶
type CommonServiceDI struct {
// contains filtered or unexported fields
}
func (*CommonServiceDI) GetService ¶
func (s *CommonServiceDI) GetService() string
Click to show internal directories.
Click to hide internal directories.