Documentation
¶
Index ¶
- func DownloadPDF(urlStr string, tmp bool, prefix string, progress func(done, total int64)) (string, error)
- func DownloadPDFForUser(urlStr string, tmp bool, prefix string, userID uuid.UUID, ...) (string, error)
- func SetDownloadTimeout(d time.Duration)
- func SetSniffTimeout(d time.Duration)
- func SniffHandler(c *gin.Context)
- func SniffMime(urlStr string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadPDF ¶
func DownloadPDF(urlStr string, tmp bool, prefix string, progress func(done, total int64)) (string, error)
DownloadPDF fetches the PDF and saves locally. tmp==true → user temp dir, else under user PDF dir/prefix. progress is an optional callback receiving bytes downloaded and total bytes.
func DownloadPDFForUser ¶ added in v1.4.0
func DownloadPDFForUser(urlStr string, tmp bool, prefix string, userID uuid.UUID, progress func(done, total int64)) (string, error)
DownloadPDFForUser fetches the PDF and saves locally for a specific user. tmp==true → user temp dir, else under user PDF dir/prefix. progress is an optional callback receiving bytes downloaded and total bytes.
func SetDownloadTimeout ¶ added in v1.0.0
SetDownloadTimeout updates the timeout for DownloadPDF requests.
func SetSniffTimeout ¶ added in v1.0.0
SetSniffTimeout updates the timeout for SniffMime requests.
func SniffHandler ¶ added in v1.0.0
SniffHandler responds with the MIME type of the ?url parameter.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.