item

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequestID  = fmt.Errorf("invalid request id")
	ErrInvalidRequestCID = fmt.Errorf("invalid request cid")
)
View Source
var (
	MaxTime = time.Unix(1<<63-62135596801, 999999999)
)

Functions

This section is empty.

Types

type Item

type Item struct {
	ID        uuid.UUID
	RootNodes []dag.Node[dag.IOSpec]
	CID       string
	Metadata  ItemMetadata
}

type ItemMetadata

type ItemMetadata struct {
	CreatedAt time.Time
	StartedAt time.Time
	EndedAt   time.Time
}

type ItemParams

type ItemParams struct {
	ID  uuid.UUID
	CID string
}

type ItemStore

type ItemStore interface {
	NewItem(ctx context.Context, params ItemParams) error
	ListItems(ctx context.Context, params PaginationParams) ([]*Item, error)
	GetItem(ctx context.Context, id uuid.UUID) (*Item, error)
}

ItemStore is an interface to retrieve and store items

func NewItemStore

func NewItemStore(ctx context.Context, database db.Queue, nodeStore dag.NodeStore[dag.IOSpec]) (ItemStore, error)

type PaginationParams added in v0.3.6

type PaginationParams struct {
	Limit         int
	CreatedBefore time.Time
	CreatedAfter  time.Time
	Reverse       bool
}

type QueueRepository

type QueueRepository interface {
	List(context.Context, PaginationParams) ([]*Item, error)
	Get(context.Context, uuid.UUID) (*Item, error)
	Create(context.Context, ItemParams) error
}

QueueRepository is a repository of Queue items

func NewQueueRepository

func NewQueueRepository(repo ItemStore, queue queue.Queue, taskFactory task.TaskFactory) (QueueRepository, error)

Jump to

Keyboard shortcuts

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