aboutsummaryrefslogtreecommitdiff
path: root/internal/service/mirror.go
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2025-05-16 14:37:12 -0500
committerSlack Coder <slackcoder@server.ky>2025-05-16 16:07:36 -0500
commitbde75151c4852029766ccafd091493f5686e4ab9 (patch)
tree850710e4526dacd76911eec50f1b98a0496ebf40 /internal/service/mirror.go
parentd75e17a48934e4896963fb0fee78dbd53f4e780b (diff)
downloadmirror-bde75151c4852029766ccafd091493f5686e4ab9.tar.xz
Enable immediate once only mirroring
Interpret Min/Max intervals of zero to mean the mirror should by pulled immediately and only once. Allow the user to be specific by adding per-mirror configuration for MinInterval and MaxInterval.
Diffstat (limited to 'internal/service/mirror.go')
-rw-r--r--internal/service/mirror.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/internal/service/mirror.go b/internal/service/mirror.go
index 43dd059..b399e9f 100644
--- a/internal/service/mirror.go
+++ b/internal/service/mirror.go
@@ -8,13 +8,20 @@ import (
)
type Mirror struct {
- Method string `toml:"method,omitempty"`
- From *internal.URL `toml:"from,omitempty"`
- To *internal.URL `toml:"to,omitempty"`
- Description string `toml:"description,omitempty"`
- StagingMethod string `toml:"staging-method,omitempty"`
- StagingPath string `toml:"staging-path,omitempty"`
- Verify string `toml:"verify,omitempty"`
+ Method string `toml:"method,omitempty"`
+ From *internal.URL `toml:"from,omitempty"`
+ To *internal.URL `toml:"to,omitempty"`
+ Description string `toml:"description,omitempty"`
+ // See global configuration.
+ MaxInterval *Duration `toml:"max-interval"`
+ // See global configuration.
+ MinInterval *Duration `toml:"min-interval"`
+ // See global configuration.
+ StagingMethod string `toml:"staging-method,omitempty"`
+ // See global configuration.
+ StagingPath string `toml:"staging-path,omitempty"`
+ // See global configuration.
+ Verify string `toml:"verify,omitempty"`
}
func (m *Mirror) Equal(arg *Mirror) bool {