From: bruce Date: Mon, 12 Jun 2023 02:48:15 +0000 (+0800) Subject: feat(all): re-arrange file tree. X-Git-Tag: v0.2.1 X-Git-Url: https://git.uzoombox.com/git/?a=commitdiff_plain;h=2799d6a61d23b4dade4523e3280844ccc577cc4e;p=uzsdk-v0.3.1.git feat(all): re-arrange file tree. --- diff --git a/go.mod b/go.mod index ec92f59..f2added 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.uzoombox.com/git/uzsdk -go 1.18 +go 1.20 require ( github.com/gin-gonic/gin v1.9.1 diff --git a/service/types/application.go b/uzsdk/application.go similarity index 94% rename from service/types/application.go rename to uzsdk/application.go index f282258..5c3dd03 100644 --- a/service/types/application.go +++ b/uzsdk/application.go @@ -1,6 +1,6 @@ // Copyright 2023 nanzoom.com. All Rights Reserved. -package types +package uzsdk // Application defines structure of application's information. type Application struct { diff --git a/service/types/configuration.go b/uzsdk/configuration.go similarity index 98% rename from service/types/configuration.go rename to uzsdk/configuration.go index a7f39f9..fff9646 100644 --- a/service/types/configuration.go +++ b/uzsdk/configuration.go @@ -1,6 +1,6 @@ // Copyright 2010-2022 nanzoom.com. All Rights Reserved. -package types +package uzsdk // Configuration defines application's configuration. type Configuration struct { diff --git a/components/logger/logger.go b/uzsdk/logger/logger.go similarity index 100% rename from components/logger/logger.go rename to uzsdk/logger/logger.go diff --git a/uzsdk.go b/uzsdk/service.go similarity index 87% rename from uzsdk.go rename to uzsdk/service.go index fe6e0ed..503ce1e 100644 --- a/uzsdk.go +++ b/uzsdk/service.go @@ -3,9 +3,8 @@ package uzsdk import ( - "git.uzoombox.com/git/uzsdk/components/logger" - "git.uzoombox.com/git/uzsdk/service/translations" - "git.uzoombox.com/git/uzsdk/service/types" + "git.uzoombox.com/git/uzsdk/uzsdk/logger" + "git.uzoombox.com/git/uzsdk/uzsdk/translations" "github.com/gin-gonic/gin" "github.com/jmoiron/sqlx" ) @@ -131,9 +130,9 @@ func Respcode(code string, options ...interface{}) Respnode { // Instance is the framework's instance, used for server & plugin both. type Instance struct { - Conf *types.Configuration // configuration of this application. - Db *sqlx.DB // the first database connection created by main routine. - Logger *logger.Logger // logger created by main routine. - Router *gin.Engine // default webservice engine created by main routine. - Maintenance bool // when maintenance mode is true, only serve api /config. + Conf *Configuration // configuration of this application. + Db *sqlx.DB // the first database connection created by main routine. + Logger *logger.Logger // logger created by main routine. + Router *gin.Engine // default webservice engine created by main routine. + Maintenance bool // when maintenance mode is true, only serve api /config. } diff --git a/service/translations/en_US.go b/uzsdk/translations/en_US.go similarity index 100% rename from service/translations/en_US.go rename to uzsdk/translations/en_US.go diff --git a/service/translations/translation.go b/uzsdk/translations/translation.go similarity index 100% rename from service/translations/translation.go rename to uzsdk/translations/translation.go diff --git a/service/translations/zh_CN.go b/uzsdk/translations/zh_CN.go similarity index 100% rename from service/translations/zh_CN.go rename to uzsdk/translations/zh_CN.go