From cb2c038c2574ed7ed5f22957a442093523c5742d Mon Sep 17 00:00:00 2001 From: WriterPass Date: Mon, 3 Feb 2025 12:53:16 +0800 Subject: [PATCH] initial commit --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4cee063 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# json-dataloader-golang + +## usage + +```shell +go get gitea.v39.writerpass.top/Public/json-configure-golang +``` + +```go +package main + +import ( + "gitea.v39.writerpass.top/Public/json-dataloader-golang/core" + "gitea.v39.writerpass.top/Public/json-dataloader-golang/utils" +) + +type SampleData struct { + Data string `json:"data"` +} + +func (receiver *SampleData) Default() { + receiver.Data = "default" +} + +func main() { + data := SampleData{} + + dataClipBuilder := core.DataClipBuilder{} + dataClipBuilder.InFile("config.json") + dataClipBuilder.RegisterType(data) + + dataClip := dataClipBuilder.Build() + data = dataClip.Setup(data).(SampleData) + + utils.PrintStruct(data, "", false) +} +``` \ No newline at end of file