ajout app
This commit is contained in:
15
Voltaserve/conversion/core/constants.go
Normal file
15
Voltaserve/conversion/core/constants.go
Normal file
@ -0,0 +1,15 @@
|
||||
package core
|
||||
|
||||
const (
|
||||
PipelinePDF = "pdf"
|
||||
PipelineOffice = "office"
|
||||
PipelineImage = "image"
|
||||
PipelineVideo = "video"
|
||||
)
|
||||
|
||||
const (
|
||||
SnapshotStatusNew = "new"
|
||||
SnapshotStatusProcessing = "processing"
|
||||
SnapshotStatusReady = "ready"
|
||||
SnapshotStatusError = "error"
|
||||
)
|
43
Voltaserve/conversion/core/types.go
Normal file
43
Voltaserve/conversion/core/types.go
Normal file
@ -0,0 +1,43 @@
|
||||
package core
|
||||
|
||||
type PipelineRunOptions struct {
|
||||
FileID string `json:"fileId"`
|
||||
SnapshotID string `json:"snapshotId"`
|
||||
Bucket string `json:"bucket"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
type SnapshotUpdateOptions struct {
|
||||
Options PipelineRunOptions `json:"options,omitempty"`
|
||||
Original *S3Object `json:"original,omitempty"`
|
||||
Preview *S3Object `json:"preview,omitempty"`
|
||||
Text *S3Object `json:"text,omitempty"`
|
||||
Thumbnail *ImageBase64 `json:"thumbnail,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type S3Object struct {
|
||||
Bucket string `json:"bucket"`
|
||||
Key string `json:"key"`
|
||||
Size int64 `json:"size"`
|
||||
Image *ImageProps `json:"image,omitempty"`
|
||||
}
|
||||
|
||||
type ImageProps struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
}
|
||||
|
||||
type ImageBase64 struct {
|
||||
Base64 string `json:"base64"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
}
|
||||
|
||||
type Pipeline interface {
|
||||
Run(PipelineRunOptions) error
|
||||
}
|
||||
|
||||
type Builder interface {
|
||||
Build(PipelineRunOptions) error
|
||||
}
|
Reference in New Issue
Block a user