go-doudou(doudou pronounce /dəudəu/)is OpenAPI 3.0 (for REST) spec and Protobuf v3 (for grpc) based lightweight microservice framework. It supports monolith service application as well.
MIT License
Bot releases are hidden (Show)
Published by wubin1989 almost 3 years ago
GDD_ENV
environment from command line or Dockerfile or k8s configuration file or IDE run/debug configuration at first. See precedence--conventions
WARN[0000] Error loading .env file: open xxx/xxx/.env: no such file or directory
Includes
and Excludes
fields to Paging
struct in esutils package to support source filtering feature of elasticsearch. See search-request-source-filtering.
String
method to Paging
struct in esutils package to prints query in pretty json format for debug purposefunc TestPaging_String(t *testing.T) {
p := Paging{
StartDate: "2021-01-01",
EndDate: "2021-10-31",
DateField: "submitTime",
QueryConds: []QueryCond{
{
Pair: map[string][]interface{}{
"user.keyword": {"wubin1989"},
"phone.keyword": {"123456"},
"district.keyword": {"Beijing"},
},
QueryLogic: MUST,
QueryType: TERMS,
},
{
Pair: map[string][]interface{}{
"score": {-1},
},
QueryLogic: MUSTNOT,
QueryType: TERMS,
},
},
}
fmt.Println(p.String())
}
Output:
{
"bool": {
"must": [
{
"range": {
"submitTime": {
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"from": "2021-01-01",
"include_lower": true,
"include_upper": true,
"time_zone": "Asia/Shanghai",
"to": "2021-10-31"
}
}
},
{
"terms": {
"user.keyword": [
"wubin1989"
]
}
},
{
"terms": {
"phone.keyword": [
"123456"
]
}
},
{
"terms": {
"district.keyword": [
"Beijing"
]
}
}
],
"must_not": {
"terms": {
"score": [
-1
]
}
}
}
}
-m
flag to specify module name to go-doudou svc init
subcommand e.g.:go-doudou svc init github.com/unionj-cloud/rabida -m github.com/unionj-cloud/rabida
where = C().Col("cc.survey_id").Eq(Literal("abc")).
And(C().Col("cc.year").Eq(Literal(2021))).
And(C().Col("cc.month").Eq(Literal(10))).
And(C().Col("cc.stat_type").Eq(Literal(2)))
fmt.Println(where.Sql())
Output:
(((cc.`survey_id` = 'abc' and cc.`year` = '2021') and cc.`month` = '10') and cc.`stat_type` = '2')
Published by wubin1989 almost 3 years ago
go-doudou -v
, output incorrect versionPublished by wubin1989 almost 3 years ago
?name[]=jack&name[]=lucy
.Published by wubin1989 about 3 years ago
Published by wubin1989 about 3 years ago
go-doudou svc run -w
command bug: panic when there is a compile error, process should wait for fix and then restart automatically.