publish-vod/pkg/uploader/interface.go
2024-03-27 18:26:13 +01:00

31 lines
646 B
Go

// Package uploader defines the interface to implement when building
// uploaders
package uploader
import (
"context"
"io"
"github.com/Luzifer/go_helpers/v2/fieldcollection"
"github.com/cheggaaa/pb/v3"
)
type (
Uploader interface {
Prepare(ctx context.Context, opts UploaderOpts) error
UploadFile(ctx context.Context, opts UploaderOpts) error
ValidateConfig(config *fieldcollection.FieldCollection) error
}
UploaderOpts struct {
Name string
Config *fieldcollection.FieldCollection
Filename string
Content io.Reader
Size int64
ProgressBar *pb.ProgressBar
FinalMessage func(format string, opts ...any)
}
)