usecase

package
v0.0.0-...-bdf6a39 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodedObjectRepository

type EncodedObjectRepository interface {
	Upload(ctx context.Context, mediaID string, localDir string) error
	GetObject(ctx context.Context, mediaID string, fileName string) (io.ReadSeekCloser, error)
}

type Encoder

type Encoder interface {
	Encode(id string, path string, audioOnly bool) (string, error)
	GetOutDirPrefix() string
}

type SourceRepository

type SourceRepository interface {
	ListUploadedFiles(ctx context.Context) iter.Seq2[entity.SourceFile, error]
	SetObjectTags(ctx context.Context, id string, tags map[string]string) error
	RemoveObjectTags(ctx context.Context, id string) error
	GetSourceContent(ctx context.Context, id string) (io.ReadSeekCloser, error)
	DeleteSourceContent(ctx context.Context, id string) error
}

type TokenIssuer

type TokenIssuer interface {
	CreateUserToken(mediaIDs []string) (string, error)
	GetMediaIDsFromToken(token string) ([]string, error)
}

type Usecase

type Usecase struct {
	// contains filtered or unexported fields
}

func NewUsecase

func NewUsecase(
	cfg config.Config,
	tokenIssuer TokenIssuer,
	encoder Encoder,
	sourceRepo SourceRepository,
	encodedRepo EncodedObjectRepository,
) (*Usecase, error)

func (*Usecase) CreateUserToken

func (u *Usecase) CreateUserToken(
	mediaIDs []string,
) (string, error)

func (*Usecase) GetMediaFile

func (u *Usecase) GetMediaFile(ctx context.Context, mediaID string, fileName string) (io.ReadSeekCloser, error)

func (*Usecase) GetMediaIDsFromToken

func (u *Usecase) GetMediaIDsFromToken(token string) ([]string, error)

func (*Usecase) Run

func (u *Usecase) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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