forked from thecodingmachine/gotenberg-go-client
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmetadata_reader.go
37 lines (27 loc) · 811 Bytes
/
metadata_reader.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package gotenberg
import "github.com/starwalkn/gotenberg-go-client/v8/document"
const endpointMetadataRead = "/forms/pdfengines/metadata/read"
type ReadMetadataRequest struct {
pdfs []document.Document
*baseRequest
}
func NewReadMetadataRequest(pdfs ...document.Document) *ReadMetadataRequest {
return &ReadMetadataRequest{
pdfs: pdfs,
baseRequest: newBaseRequest(),
}
}
func (rmd *ReadMetadataRequest) endpoint() string {
return endpointMetadataRead
}
func (rmd *ReadMetadataRequest) formDocuments() map[string]document.Document {
files := make(map[string]document.Document)
for _, pdf := range rmd.pdfs {
files[pdf.Filename()] = pdf
}
return files
}
// Compile-time checks to ensure type implements desired interfaces.
var (
_ = multipartRequester(new(ReadMetadataRequest))
)