mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
generate last-modified string at settings init
This commit is contained in:
parent
77dfd64445
commit
c4f7bb7604
4 changed files with 14 additions and 9 deletions
|
@ -1,14 +1,18 @@
|
|||
package settings
|
||||
|
||||
import (
|
||||
"github.com/spf13/cast"
|
||||
"gopkg.in/ini.v1"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Conf *ini.File
|
||||
|
||||
var (
|
||||
BuildTime string
|
||||
buildTime string
|
||||
LastModified string
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
|
@ -36,6 +40,11 @@ var sections = map[string]interface{}{
|
|||
"server": ServerSettings,
|
||||
}
|
||||
|
||||
func init() {
|
||||
t := time.Unix(cast.ToInt64(buildTime), 0)
|
||||
LastModified = strings.ReplaceAll(t.Format(time.RFC1123), "UTC", "GMT")
|
||||
}
|
||||
|
||||
func Init(confPath string) {
|
||||
ConfPath = confPath
|
||||
Setup()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue