versioner.go 717 B

1234567891011121314151617181920
  1. // Copyright (C) 2014 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at http://mozilla.org/MPL/2.0/.
  6. // Package versioner implements common interfaces for file versioning and a
  7. // simple default versioning scheme.
  8. package versioner
  9. type Versioner interface {
  10. Archive(filePath string) error
  11. }
  12. var Factories = map[string]func(folderID string, folderDir string, params map[string]string) Versioner{}
  13. const (
  14. TimeFormat = "20060102-150405"
  15. TimeGlob = "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]" // glob pattern matching TimeFormat
  16. )