20 lines
405 B
Go
20 lines
405 B
Go
package widget
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Pool interface {
|
|
Exec(ctx context.Context, query string, args ...interface{}) (interface{}, error)
|
|
Query(ctx context.Context, query string, args ...interface{}) (interface{}, error)
|
|
QueryRow(ctx context.Context, query string, args ...interface{}) interface{}
|
|
}
|
|
|
|
type Repository struct {
|
|
Pool
|
|
}
|
|
|
|
func New(pool Pool) *Repository {
|
|
return &Repository{pool}
|
|
}
|