package dps import ( "git.sxidc.com/service-supports/dps-sdk/client" ) var dpsClient client.Client func InitInstance(address string, clientVersion string, databaseID string) error { c, err := NewClient(address, clientVersion, databaseID) if err != nil { return err } dpsClient = c return nil } func DestroyInstance(clientVersion string, databaseID string) error { err := DestroyClient(clientVersion, databaseID) if err != nil { return err } return nil } func AutoMigrate(items ...client.AutoMigrateItem) error { if items == nil || len(items) == 0 { return nil } return dpsClient.AutoMigrate(&client.AutoMigrateRequest{Items: items}) } func Transaction(txFunc client.TransactionFunc) error { return dpsClient.Transaction(txFunc) }