Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

leveldb.go 580B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package nosql
  4. import "net/url"
  5. // ToLevelDBURI converts old style connections to a LevelDBURI
  6. //
  7. // A LevelDBURI matches the pattern:
  8. //
  9. // leveldb://path[?[option=value]*]
  10. //
  11. // We have previously just provided the path but this prevent other options
  12. func ToLevelDBURI(connection string) *url.URL {
  13. uri, err := url.Parse(connection)
  14. if err == nil && uri.Scheme == "leveldb" {
  15. return uri
  16. }
  17. uri, _ = url.Parse("leveldb://common")
  18. uri.Host = ""
  19. uri.Path = connection
  20. return uri
  21. }