Documentation ¶
Index ¶
- func CheckVersion(coll *mongo.Collection, key string, currentVersion int) error
- func IsMySQLTableNotExist(err error) bool
- func NewMongo(conf MongoConfig) (*mongo.Database, error)
- func NewMySQL(conf MySQLConfig) (*gorm.DB, error)
- func NewTask[A interface{ ... }, B any, C any](gormDB *gorm.DB, mongoDB *mongo.Database, ...) error
- func ParseConfig[T any](path string) (*T, error)
- func SetVersion(coll *mongo.Collection, key string, version int) error
- type MongoConfig
- type MySQLConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
func CheckVersion(coll *mongo.Collection, key string, currentVersion int) error
func IsMySQLTableNotExist ¶
func NewTask ¶
func NewTask[A interface{ TableName() string }, B any, C any](gormDB *gorm.DB, mongoDB *mongo.Database, mongoDBInit func(db *mongo.Database) (B, error), convert func(v A) C) error
NewTask A mysql table B mongodb model C mongodb table
func ParseConfig ¶
func SetVersion ¶
func SetVersion(coll *mongo.Collection, key string, version int) error
Types ¶
type MongoConfig ¶
Click to show internal directories.
Click to hide internal directories.