You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
502 B
24 lines
502 B
3 years ago
|
package data
|
||
|
|
||
|
import (
|
||
|
"github.com/go-kratos/kratos/examples/i18n/internal/conf"
|
||
|
"github.com/go-kratos/kratos/v2/log"
|
||
|
"github.com/google/wire"
|
||
|
)
|
||
|
|
||
|
// ProviderSet is data providers.
|
||
|
var ProviderSet = wire.NewSet(NewData, NewGreeterRepo)
|
||
|
|
||
|
// Data .
|
||
|
type Data struct {
|
||
|
// TODO warpped database client
|
||
|
}
|
||
|
|
||
|
// NewData .
|
||
|
func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error) {
|
||
|
cleanup := func() {
|
||
|
logger.Log(log.LevelInfo, "closing the data resources")
|
||
|
}
|
||
|
return &Data{}, cleanup, nil
|
||
|
}
|