diff --git a/conf/serve.go b/conf/serve.go index e68fb79..a034205 100644 --- a/conf/serve.go +++ b/conf/serve.go @@ -1,10 +1,41 @@ package conf +import ( + "os" + "path" + "path/filepath" + "strings" +) + type ServeYaml struct { DataStorage string `yaml:"dataStorage"` Domains []string `yaml:"domains"` RangeSupported bool `yaml:"rangeSupported"` - FilterURLQueries bool `yaml:"filterURLQueries"` EnableGoInfoPage bool `yaml:"enableGoInfoPage"` CacheSettings CacheSettingsYaml `yaml:"cacheSettings"` } + +func (sy ServeYaml) GetDomainString() string { + if len(sy.Domains) == 0 { + return "all" + } else { + return strings.Join(sy.Domains, " ") + } +} + +func (sy ServeYaml) GetDataStoragePath() string { + if sy.DataStorage == "" || !filepath.IsAbs(sy.DataStorage) { + wd, err := os.Getwd() + if err != nil { + return "" + } else { + if sy.DataStorage == "" { + return wd + } else { + return path.Join(wd, sy.DataStorage) + } + } + } else { + return sy.DataStorage + } +} diff --git a/goinfo.go.html b/goinfo.go.html new file mode 100644 index 0000000..3269a0a --- /dev/null +++ b/goinfo.go.html @@ -0,0 +1,311 @@ + + +
+ + + ++
+ {{ if .FullOutput }} +
+
Product Name | +{{ .ProductName }} | +
---|---|
Product Description | +{{ .ProductDescription }} | +
Product Location | +{{ .ProductLocation }} | +
Build Commit | +#{{ .BuildVersion }} | +
Build Date | +{{ .BuildDate }} | +
Working Directory | +{{ .WorkingDirectory }} | +
Process ID | +{{ .ProcessID }} | +
Parent Process ID | +{{ .ParentProcessID }} | +
+
Go Version | +{{ .GoVersion }} | +
---|---|
Go Toolchain | +{{ .Compiler }} | +
GOROOT | +{{ .GoRoot }} | +
GOMAXPROCS | +{{ .GoMaxProcs }} | +
Go Routine Count | +{{ .GoRoutineNum }} | +
Go c go call Count | +{{ .GoCGoCallNum }} | +
+
Hostname | +{{ .Hostname }} | +
---|---|
Operating System | +{{ .GoOS }} | +
Architecture | +{{ .GoArch }} | +
Number of Cores | +{{ .NumCPU }} | +
Memory Page Size | +{{ .PageSize }} | +
+
Listen Type | +{{ .ListenSettings.WebNetwork }} | +
---|---|
Listening Address | +{{ .ListenSettings.Web }} | +
Listening Method | +{{ .ListenSettings.WebMethod }} | +
Identifying | +{{ .ListenSettings.Identify }} | +
Server | +Clerie Gilbert | +
Powered By | +Love | +
Friendly | +True | +
+
Template Storage Path | +{{ .ServeSettings.GetDataStoragePath }} | +
---|---|
Served Domains | +{{ .ServeSettings.GetDomainString }} | +
Range Supported | +{{ .ServeSettings.RangeSupported }} | +
+
Enable Template Caching | +{{ .ServeSettings.CacheSettings.EnableTemplateCaching }} | +
---|---|
Enable Template Cache Purge | +{{ .ServeSettings.CacheSettings.EnableTemplateCachePurge }} | +
Enable Content Caching | +{{ .ServeSettings.CacheSettings.EnableContentsCaching }} | +
Enable Content Cache Purge | +{{ .ServeSettings.CacheSettings.EnableContentsCachePurge }} | +
Max Age | +{{ .ServeSettings.CacheSettings.MaxAge }} | +
Enable Last Modified Precondition Support | +{{ .ServeSettings.CacheSettings.NotModifiedResponseUsingLastModified }} | +
Enable ETag Precondition Support | +{{ .ServeSettings.CacheSettings.NotModifiedResponseUsingETags }} | +
+
Environment Variables | +
---|
{{ . }} | +
+
Number of Registered Pages | +{{ len .RegisteredPages }} | +
---|
+
Registered Pages | +
---|
{{ . }} | +
+
Number of Cached Pages | +{{ len .CachedPages }} | +
---|
+
Cached Pages | +
---|
{{ . }} | +
+ {{ if .FullOutput }} +