-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
56 additions
and
537 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,3 +1,25 @@ | ||
# toolbox | ||
|
||
Toolbox is a golang base common library | ||
Toolbox is a golang base common library. | ||
|
||
util is short for "utility", typically referring to general-purpose tool functions and methods that are independent of specific business logic. | ||
|
||
The diference between utils and kits is that the utils is a collection of functions, without any dependencies. | ||
|
||
• Characteristics: | ||
• Lightweight, focused on specific small functions or independent functional points | ||
• No clear domain restrictions, usually consisting of scattered utility functions | ||
• Commonly used to support higher-level business logic | ||
|
||
• Usage Scenarios: | ||
• Handling common tasks such as string operations, date formatting, data conversion, etc. | ||
• Independent of specific business logic or context | ||
|
||
• Examples: | ||
• Node.js util module: provides general utility functions like util.promisify, util.format | ||
• lodash utility library: includes many common utility functions like deep copy, array deduplication, etc. | ||
|
||
|
||
## Reference | ||
|
||
[gookit/goutil](https://github.com/gookit/goutil) |
This file was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
package deploykit | ||
package deployutil | ||
|
||
import ( | ||
"os" | ||
|
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,14 +1,14 @@ | ||
package deploykit_test | ||
package deployutil_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/airdb/toolbox/deploykit" | ||
"github.com/airdb/toolbox/deployutil" | ||
. "github.com/smartystreets/goconvey/convey" | ||
) | ||
|
||
func TestToEnv(t *testing.T) { | ||
Convey("Given array with few string value", t, func() { | ||
So(deploykit.ToEnv("blue"), ShouldEqual, deploykit.DeployPolicyBlue) | ||
So(deployutil.ToEnv("blue"), ShouldEqual, deployutil.DeployPolicyBlue) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
package asn2ip | ||
package netutil | ||
|
||
import ( | ||
"bytes" | ||
|
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,4 +1,4 @@ | ||
package netkit_test | ||
package netutil_test | ||
|
||
/* | ||
import ( | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.