repository

package
v0.0.0-...-f737b9d Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	IDs            []string
	Statuses       []mapreduce.TaskStatus
	Limit          *uint32
	Offset         *uint32
	OrderBy        *OrderField
	OrderDirection *OrderDirection
	InProgressFor  *time.Duration
}

func (Filter) String

func (f Filter) String() string

type OrderDirection

type OrderDirection int
const (
	Ascending OrderDirection = iota
	Descending
)

func (OrderDirection) String

func (od OrderDirection) String() string

type OrderField

type OrderField int
const (
	OrderByCreatedAt OrderField = iota
)

func (OrderField) String

func (of OrderField) String() string

type Tasks

type Tasks interface {
	Transaction

	CreateMapTask(ctx context.Context, task mapreduce.MapTask) error
	CreateReduceTask(ctx context.Context, task mapreduce.ReduceTask) error

	UpdateMapTask(ctx context.Context, task mapreduce.MapTask) error
	UpdateReduceTask(ctx context.Context, task mapreduce.ReduceTask) error

	UpdateMapTasks(ctx context.Context, ids []string, fields UpdateFields) error
	UpdateReduceTasks(ctx context.Context, ids []string, fields UpdateFields) error

	GetMapTask(ctx context.Context, id string) (mapreduce.MapTask, error)
	GetReduceTask(ctx context.Context, id string) (mapreduce.ReduceTask, error)

	QueryMapTasks(ctx context.Context, filter Filter) ([]mapreduce.MapTask, error)
	QueryReduceTasks(ctx context.Context, filter Filter) ([]mapreduce.ReduceTask, error)
}

func NewMongoDBTasksRepository

func NewMongoDBTasksRepository(ctx context.Context, config config.MongoDB, log logger.Logger) (Tasks, error)

func NewTestMongoDBTasksRepository

func NewTestMongoDBTasksRepository(t *testing.T) (Tasks, *mongodb.MongoDBContainer)

type Transaction

type Transaction interface {
	Transaction(ctx context.Context, transaction func(ctx context.Context) (any, error)) (any, error)
}

type UpdateFields

type UpdateFields struct {
	Status        *mapreduce.TaskStatus
	RescheduledAt *time.Time
}

type UpdateFieldsMatcher

type UpdateFieldsMatcher struct {
	UpdateFields
}

func (UpdateFieldsMatcher) Matches

func (m UpdateFieldsMatcher) Matches(x interface{}) bool

func (UpdateFieldsMatcher) String

func (m UpdateFieldsMatcher) String() string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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