-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ZhangJian He <[email protected]>
- Loading branch information
ZhangJian He
committed
Dec 29, 2024
1 parent
3e30636
commit e34b216
Showing
4 changed files
with
138 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
module github.com/opengemini/opengemini-client-go-application | ||
|
||
go 1.20 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/libgox/buffer v0.0.0-20241031081046-5d4932c890d4 | ||
github.com/libgox/envx v0.0.0-20241031234047-a094467ecb9f | ||
github.com/libgox/flyway v0.0.0-20241031081155-664faf8b516f | ||
github.com/libgox/gocollections v0.0.0-20241031081053-07bce0388f78 | ||
github.com/libgox/retry v0.0.0-20241101011336-167b47045bd9 | ||
github.com/libgox/spring-cloud-go v0.0.3-0.20241026022417-5db252b8b188 | ||
github.com/libgox/unicodex v0.0.1 | ||
github.com/protocol-laboratory/opcua-go v0.0.0-20241022080800-2ff8b0ffb7c8 | ||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 | ||
github.com/libgox/addr v0.2.0 | ||
github.com/libgox/asciitable v0.0.0-20241225014119-5902387d688c | ||
github.com/libgox/buffer v0.1.0 | ||
github.com/libgox/envx v0.2.0 | ||
github.com/libgox/flyway v0.2.0 | ||
github.com/libgox/gocollections v0.1.1 | ||
github.com/libgox/must v1.0.0 | ||
github.com/libgox/properties v0.1.0 | ||
github.com/libgox/retry v0.1.0 | ||
github.com/libgox/slogsimple v0.3.0 | ||
github.com/libgox/spring-cloud-go v0.3.0 | ||
github.com/libgox/unicodex v0.1.0 | ||
github.com/protocol-laboratory/opcua-go v0.0.0-20241105090735-5a1bb4fc587d | ||
github.com/protocol-laboratory/zookeeper-client-go v0.3.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/libgox/addr v0.2.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/protocol-laboratory/zookeeper-client-go v0.0.4-0.20241026020853-9929d040af36 // indirect | ||
github.com/stretchr/testify v1.9.0 // indirect | ||
github.com/stretchr/testify v1.10.0 // indirect | ||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
package boot | ||
|
||
import ( | ||
"log/slog" | ||
"os" | ||
|
||
"github.com/libgox/envx" | ||
"golang.org/x/exp/slog" | ||
"github.com/libgox/slogsimple" | ||
) | ||
|
||
type ClientApplication struct { | ||
type Application struct { | ||
logger *slog.Logger | ||
} | ||
|
||
func NewClientApplication() *ClientApplication { | ||
func NewTestClientApplication() *Application { | ||
logger := slog.Default() | ||
envx.GetStrOr("POD_NAME", "defaultName") | ||
logger.Info("Starting client application") | ||
return &ClientApplication{} | ||
return &Application{} | ||
} | ||
|
||
func (a *Application) Boot() { | ||
a.logger = slog.New(slogsimple.NewHandler(&slogsimple.Config{ | ||
Output: os.Stdout, | ||
MinLevel: slog.LevelInfo, | ||
})) | ||
} |