mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-03 09:08:35 +00:00
update docs
This commit is contained in:
parent
84144d823d
commit
6341aebe66
13 changed files with 139 additions and 19 deletions
|
@ -844,7 +844,7 @@ const docTemplate = `{
|
|||
"types.Build": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"build_time": {
|
||||
"buildTime": {
|
||||
"type": "string"
|
||||
},
|
||||
"commit": {
|
||||
|
|
|
@ -836,7 +836,7 @@
|
|||
"types.Build": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"build_time": {
|
||||
"buildTime": {
|
||||
"type": "string"
|
||||
},
|
||||
"commit": {
|
||||
|
|
|
@ -31,7 +31,7 @@ definitions:
|
|||
type: object
|
||||
types.Build:
|
||||
properties:
|
||||
build_time:
|
||||
buildTime:
|
||||
type: string
|
||||
commit:
|
||||
type: string
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
func (a *app) setupLogger() {
|
||||
// Logger Init
|
||||
// zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
if a.conf.Mode != config.ModeProduction {
|
||||
if a.conf.Log.Format != config.LogFormatJSON {
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ func TestHandlersv1_HandleBase(t *testing.T) {
|
|||
}
|
||||
|
||||
// Validate Json Payload
|
||||
expected := `{"health":true,"versions":null,"title":"Go API Template","message":"Welcome to the Go API Template Application!","Build":{"version":"0.1.0","commit":"HEAD","build_time":"now"}}`
|
||||
expected := `{"health":true,"versions":null,"title":"Go API Template","message":"Welcome to the Go API Template Application!","Build":{"version":"0.1.0","commit":"HEAD","buildTime":"now"}}`
|
||||
|
||||
if rr.Body.String() != expected {
|
||||
t.Errorf("Expected json to be %s, got %s", expected, rr.Body.String())
|
||||
|
|
|
@ -40,7 +40,7 @@ type WebConfig struct {
|
|||
func NewConfig(file string) (*Config, error) {
|
||||
var cfg Config
|
||||
|
||||
const prefix = "API"
|
||||
const prefix = "HBOX"
|
||||
|
||||
help, err := func() (string, error) {
|
||||
if _, err := os.Stat(file); errors.Is(err, os.ErrNotExist) {
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package config
|
||||
|
||||
const (
|
||||
LogFormatJSON = "json"
|
||||
LogFormatText = "text"
|
||||
)
|
||||
|
||||
type LoggerConf struct {
|
||||
Level string `conf:"default:debug"`
|
||||
File string `conf:""`
|
||||
Level string `conf:"default:info"`
|
||||
Format string `conf:"default:text"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue