2020-03-27 11:01:41 +01:00
|
|
|
/*
|
2022-04-25 09:53:55 +02:00
|
|
|
Package webdav provides WebDAV file sharing and synchronization.
|
2020-06-23 13:44:14 +02:00
|
|
|
|
2023-01-11 16:43:01 +01:00
|
|
|
Copyright (c) 2018 - 2023 PhotoPrism UG. All rights reserved.
|
2020-06-23 13:44:14 +02:00
|
|
|
|
2022-08-10 16:09:21 +02:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under Version 3 of the GNU Affero General Public License (the "AGPL"):
|
|
|
|
<https://docs.photoprism.app/license/agpl>
|
2020-06-23 13:44:14 +02:00
|
|
|
|
2022-08-10 16:09:21 +02:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
2020-06-23 13:44:14 +02:00
|
|
|
|
2022-08-10 16:09:21 +02:00
|
|
|
The AGPL is supplemented by our Trademark and Brand Guidelines,
|
|
|
|
which describe how our Brand Assets may be used:
|
2023-02-08 09:07:42 +01:00
|
|
|
<https://www.photoprism.app/trademark>
|
2020-06-23 13:44:14 +02:00
|
|
|
|
2022-04-13 22:17:59 +02:00
|
|
|
Feel free to send an email to hello@photoprism.app if you have questions,
|
2020-06-23 13:44:14 +02:00
|
|
|
want to support our work, or just want to say hello.
|
2020-03-27 11:01:41 +01:00
|
|
|
|
|
|
|
Additional information can be found in our Developer Guide:
|
2022-02-27 17:32:54 +01:00
|
|
|
<https://docs.photoprism.app/developer-guide/>
|
2020-03-27 11:01:41 +01:00
|
|
|
*/
|
|
|
|
package webdav
|
|
|
|
|
|
|
|
import (
|
2020-04-24 14:11:17 +02:00
|
|
|
"time"
|
2020-03-27 11:01:41 +01:00
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/event"
|
|
|
|
)
|
|
|
|
|
2022-03-27 21:37:11 +02:00
|
|
|
// Global log instance.
|
2020-03-27 11:01:41 +01:00
|
|
|
var log = event.Log
|
|
|
|
|
2022-03-27 21:37:11 +02:00
|
|
|
type Timeout string
|
|
|
|
|
|
|
|
// Request Timeout options.
|
|
|
|
const (
|
|
|
|
TimeoutHigh Timeout = "high" // 120 * Second
|
|
|
|
TimeoutDefault Timeout = "" // 60 * Second
|
|
|
|
TimeoutMedium Timeout = "medium" // 60 * Second
|
|
|
|
TimeoutLow Timeout = "low" // 30 * Second
|
|
|
|
TimeoutNone Timeout = "none" // 0
|
|
|
|
)
|
|
|
|
|
|
|
|
// Second represents a second on which other timeouts are based.
|
|
|
|
const Second = time.Second
|
2020-12-05 01:24:33 +01:00
|
|
|
|
2022-03-27 21:37:11 +02:00
|
|
|
// MaxRequestDuration is the maximum request duration e.g. for recursive retrieval of large remote directory structures.
|
|
|
|
const MaxRequestDuration = 30 * time.Minute
|
|
|
|
|
|
|
|
// Durations maps Timeout options to specific time durations.
|
|
|
|
var Durations = map[Timeout]time.Duration{
|
|
|
|
TimeoutHigh: 120 * Second,
|
|
|
|
TimeoutDefault: 60 * Second,
|
|
|
|
TimeoutMedium: 60 * Second,
|
|
|
|
TimeoutLow: 30 * Second,
|
|
|
|
TimeoutNone: 0,
|
|
|
|
}
|