usecase

package
v0.0.0-...-732dc05 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Progress

type Progress struct {
	Done  uint64
	Total uint64
}

Progress type is used to represent progress of generation.

type TaskConfig

type TaskConfig struct {
	GenerationConfig   *models.GenerationConfig
	Output             output.Output
	ContinueGeneration bool
	HTTPDelivery       bool
}

TaskConfig type is used to describe config for task.

type UseCase

type UseCase interface {
	// Setup function should configure some use case parameters.
	Setup() error
	// CreateTask function should start task to generate data and send it to output.
	CreateTask(ctx context.Context, config TaskConfig) (string, error)
	// GetProgress should return progress of data generation
	GetProgress(taskID string) (map[string]Progress, error)
	// GetResult should return task status (completed or not) and an error if necessary.
	GetResult(taskID string) (bool, error)
	// WaitResult should wait data generation and return error if needed
	WaitResult(taskID string) error
	// Teardown function should wait generation finish
	Teardown() error
}

UseCase interface implementation should listen delivery and generate data by params.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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