27 lines
413 B
Go
Executable File
27 lines
413 B
Go
Executable File
package middlewares
|
|
|
|
import (
|
|
"quyun/v2/providers/jwt"
|
|
|
|
"go.ipao.vip/atom/container"
|
|
"go.ipao.vip/atom/opt"
|
|
)
|
|
|
|
func Provide(opts ...opt.Option) error {
|
|
if err := container.Container.Provide(func(
|
|
jwt *jwt.JWT,
|
|
) (*Middlewares, error) {
|
|
obj := &Middlewares{
|
|
jwt: jwt,
|
|
}
|
|
if err := obj.Prepare(); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return obj, nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|