repository

package
v0.0.0-...-3fab451 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound = errors.New("record not found")
	ErrDuplicatedKey  = errors.New("duplicated key")
)

Functions

This section is empty.

Types

type LogDao

type LogDao interface {
	InsertLogs(ctx context.Context, logs []do.Log) error
}

func NewLogDao

func NewLogDao(db *gorm.DB) LogDao

type Repository

type Repository interface {
	Transaction(fn func(Repository) error) error

	TaskDao() TaskDao
	LogDao() LogDao
}

func NewPgRepository

func NewPgRepository(lg *zap.Logger, cfg config.PgConfig) Repository

type TaskDao

type TaskDao interface {
	InsertTask(ctx context.Context, task do.Task) (do.Task, error)
	UpdateTask(ctx context.Context, task do.Task) (do.Task, error)
	GetTask(ctx context.Context, name string) (do.Task, error)
	GetTaskForUpdate(ctx context.Context, name string) (do.Task, error)
}

func NewTaskDao

func NewTaskDao(db *gorm.DB) TaskDao

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL