Documentation
¶
Index ¶
- Variables
- type AttemptDAO
- type BaseDAO
- type DAO
- func (dao *DAO[T]) BatchInsert(ctx context.Context, entities []*T) error
- func (dao *DAO[T]) Count(ctx context.Context, where map[string]interface{}) (total int64, err error)
- func (dao *DAO[T]) DB(ctx context.Context) Queryable
- func (dao *DAO[T]) Delete(ctx context.Context, id string) (bool, error)
- func (dao *DAO[T]) Get(ctx context.Context, id string) (entity *T, err error)
- func (dao *DAO[T]) Insert(ctx context.Context, entity *T) error
- func (dao *DAO[T]) List(ctx context.Context, q query.Queryer) (list []*T, err error)
- func (dao *DAO[T]) Page(ctx context.Context, q query.Queryer) (list []*T, total int64, err error)
- func (dao *DAO[T]) UnsafeDB(ctx context.Context) Queryable
- func (dao *DAO[T]) Update(ctx context.Context, entity *T) error
- type EndpointDAO
- type EventDAO
- type Queryable
- type SourceDAO
- type WorkspaceDAO
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRows = sql.ErrNoRows ErrConstraintViolation = errors.New("constraint violation") )
Functions ¶
This section is empty.
Types ¶
type AttemptDAO ¶
type AttemptDAO interface { BaseDAO[entities.Attempt] UpdateStatus(ctx context.Context, id string, status entities.AttemptStatus) error UpdateDelivery(ctx context.Context, id string, request *entities.AttemptRequest, response *entities.AttemptResponse, attemptAt time.Time, status entities.AttemptStatus) error }
func NewAttemptDao ¶
func NewAttemptDao(db *sqlx.DB, workspace bool) AttemptDAO
type BaseDAO ¶
type BaseDAO[T any] interface { Get(ctx context.Context, id string) (*T, error) Insert(ctx context.Context, entity *T) error Update(ctx context.Context, entity *T) error Delete(ctx context.Context, id string) (bool, error) Page(ctx context.Context, q query.Queryer) ([]*T, int64, error) List(ctx context.Context, q query.Queryer) ([]*T, error) BatchInsert(ctx context.Context, entities []*T) error }
type DAO ¶
type DAO[T any] struct { // contains filtered or unexported fields }
func (*DAO[T]) BatchInsert ¶
type EndpointDAO ¶
func NewEndpointDAO ¶
func NewEndpointDAO(db *sqlx.DB, workspace bool) EndpointDAO
type Queryable ¶
type Queryable interface { sqlx.ExtContext GetContext(context.Context, interface{}, string, ...interface{}) error SelectContext(context.Context, interface{}, string, ...interface{}) error }
Queryable is an interface to be used interchangeably for sqlx.Db and sqlx.Tx
type WorkspaceDAO ¶
type WorkspaceDAO interface { BaseDAO[entities.Workspace] GetDefault(ctx context.Context) (*entities.Workspace, error) }
func NewWorkspaceDAO ¶
func NewWorkspaceDAO(db *sqlx.DB) WorkspaceDAO
Click to show internal directories.
Click to hide internal directories.