variabl.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2025 BackendServerTemplate Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package global
  5. import (
  6. resource "github.com/SongZihuan/BackendServerTemplate"
  7. "github.com/SongZihuan/BackendServerTemplate/src/utils/timeutils"
  8. "time"
  9. )
  10. var (
  11. // Version SemanticVersioning License Report BuildTime GitCommitHash GitTag GitTagCommitHash 继承自resource(程序init完成后即可调用)
  12. Version = resource.Version
  13. SemanticVersioning = resource.SemanticVersioning
  14. License = resource.License
  15. Report = resource.Report
  16. BuildTime = resource.BuildTime
  17. GitCommitHash = resource.GitCommitHash
  18. GitTag = resource.GitTag
  19. GitTagCommitHash = resource.GitTagCommitHash
  20. // Name 继承自resource
  21. // 注意:命令行参数或配置文件加载时可能会被更改
  22. Name = resource.Name
  23. NameFlagChanged = false
  24. )
  25. // Location 以下变量需要在配置文件加载完毕后才可调用
  26. var (
  27. UTCLocation = time.UTC
  28. LocalLocation = timeutils.GetLocalTimezone()
  29. Location = time.UTC
  30. )