forked from mtusi2026/mtusi2026lab5
Prepare verified laboratory 5 implementation and evidence
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package port
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Passwords interface {
|
||||
Hash(string) (string, error)
|
||||
Verify(string, string) bool
|
||||
}
|
||||
type Sessions interface {
|
||||
Credentials(context.Context, string) (uuid.UUID, string, error)
|
||||
CreateSession(context.Context, string, uuid.UUID, time.Time) error
|
||||
AuthenticateSession(context.Context, string) (uuid.UUID, error)
|
||||
RevokeSession(context.Context, string) error
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package port
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Object struct {
|
||||
Key, ETag string
|
||||
Size int64
|
||||
Modified time.Time
|
||||
}
|
||||
type Objects interface {
|
||||
Put(context.Context, string, io.Reader, int64, string) error
|
||||
Get(context.Context, string) (io.ReadCloser, error)
|
||||
Stat(context.Context, string) (Object, error)
|
||||
Remove(context.Context, string) error
|
||||
List(context.Context, string) ([]Object, bool, error)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package port
|
||||
|
||||
import (
|
||||
"backend/internal/domain/model"
|
||||
"context"
|
||||
"github.com/google/uuid"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PipelineStore interface {
|
||||
PendingJobs(context.Context) ([]model.Job, error)
|
||||
Published(context.Context, uuid.UUID) error
|
||||
AcquireJob(context.Context, model.Job, uuid.UUID, time.Duration) (model.Job, model.Attachment, bool, error)
|
||||
CompleteJob(context.Context, model.Job, uuid.UUID, []model.Variant) (bool, error)
|
||||
RetryJob(context.Context, model.Job, uuid.UUID, string, time.Duration, bool) error
|
||||
ReplayJob(context.Context, uuid.UUID) (bool, error)
|
||||
AdvancePipeline(context.Context, uuid.UUID) (bool, error)
|
||||
StagingCleanup(context.Context) ([]model.Attachment, error)
|
||||
StagingCleaned(context.Context, uuid.UUID) error
|
||||
}
|
||||
type Transformer interface {
|
||||
Transform(context.Context, io.Reader) ([]ProcessedVariant, error)
|
||||
}
|
||||
type ProcessedVariant struct {
|
||||
Metadata model.Variant
|
||||
Bytes []byte
|
||||
}
|
||||
Reference in New Issue
Block a user