28 lines
354 B
Go
28 lines
354 B
Go
package database
|
|
|
|
/*
|
|
|
|
Example usage:
|
|
|
|
ctx, _ := context.WithCancel(context.Background())
|
|
dba = &db.Actor{
|
|
DB: s.db,
|
|
ActionChan: make(chan database.Func),
|
|
}
|
|
|
|
go dba.Run(ctx)
|
|
|
|
*/
|
|
|
|
/*
|
|
Transactor Example:
|
|
|
|
func insert(ctx context.Context, db *sql.DB) error{
|
|
// SQL HERE
|
|
}
|
|
|
|
...
|
|
|
|
dba.ActionChan <- db.WithTransaction(insert)
|
|
*/
|