From 2554eb5e35a3bc46bb5b6187d854ef88715f65d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd-Ren=C3=A9=20Predota?= Date: Tue, 11 May 2021 10:00:02 +0200 Subject: [PATCH] cmd moved --- {lib/cmd => cmd}/cmd.go | 0 {lib/cmd => cmd}/cmd_test.go | 0 main.go | 3 +-- models/user.go | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) rename {lib/cmd => cmd}/cmd.go (100%) rename {lib/cmd => cmd}/cmd_test.go (100%) diff --git a/lib/cmd/cmd.go b/cmd/cmd.go similarity index 100% rename from lib/cmd/cmd.go rename to cmd/cmd.go diff --git a/lib/cmd/cmd_test.go b/cmd/cmd_test.go similarity index 100% rename from lib/cmd/cmd_test.go rename to cmd/cmd_test.go diff --git a/main.go b/main.go index 8698efa..1c9f6a7 100644 --- a/main.go +++ b/main.go @@ -5,8 +5,8 @@ import ( "strings" "time" + "git.devices.local/mawas/golang-api-skeleton/cmd" "git.devices.local/mawas/golang-api-skeleton/lib/cache" - "git.devices.local/mawas/golang-api-skeleton/lib/cmd" "git.devices.local/mawas/golang-api-skeleton/lib/common" "git.devices.local/mawas/golang-api-skeleton/lib/config" "git.devices.local/mawas/golang-api-skeleton/lib/database" @@ -24,7 +24,6 @@ import ( // FIXME how to set unique index for username to make soft deletes possible but disallow duplicates... also how to cache a username which got delete and recerated... user ID would get overwritten, maybe pre/suffix deleted username? // TODO use badgerdb for permissions? path:[token1, token2...] // TODO add database loadbalancing feature... so allow more hosts use first as default and other ones as fallback -// TODO add userid and username to repo // TODO usrid and username for cli user is hardcoded.. no need to live in database // TODO get-stats cli command... which means unix socket support to communicate with server // TODO data versioning which will be used as reference from the log, also with predictive analytics for restore which means versioning of reference objects needs to be considered diff --git a/models/user.go b/models/user.go index 71c5287..001947d 100644 --- a/models/user.go +++ b/models/user.go @@ -38,7 +38,7 @@ func (user *User) AfterFind(tx *gorm.DB) error { user.Tokens = append(user.Tokens, user.TokensRef[i].Token.String()) } if len(user.Tokens) == 0 { - user.Tokens = []string{""} + user.Tokens = []string{} } if cc, ok := tx.Get("cache"); ok { if c, ok := cc.(cache.Cache); ok {