Commit Graph

708 Commits (dd01695d4593e085bd9780f801a1373c2509d4fc)

Author SHA1 Message Date
Kevin Wan 300b124e42
docs: update goctl readme (#2136) 2 years ago
Richard Yi 6e50c87dca
fix: generated sql query fields do not match template (#2004)
* Fix typo

* Match generated sql query fields with template
2 years ago
Kevin Wan 1c09db6d5d
chore: coding style (#2120) 2 years ago
LeeDF 96acf1f5a6
fix goctl rpc protoc strings.EqualFold Service.Name GoPackage (#2046) 2 years ago
Kevin Wan 97a171441d
chore: remove blank lines (#2117)
* chore: remove blank lines

* chore: refactor
2 years ago
虫子樱桃 725e6056e1
feat:`goctl model mongo ` add `easy` flag for easy declare. (#2073)
* fix:typo in readme.md

* feat:`goctl model mongo ` add `easy` flag to generate code with Auto generated CollectionName for easy declare.

* fix:`goctl api doc ` when referenced api file contains no route,will generate an empty markdown file.

* code: adjust code.

Co-authored-by: 虫子樱桃 <czyt@w.cn>
2 years ago
Kevin Wan b364c54940
chore: update goctl version to 1.3.9 (#2111) 2 years ago
Kevin Wan e0e3f97c7c
chore: refactor (#2087) 2 years ago
taobig 6a2d6786c6
remove legacy code (#2086) 2 years ago
taobig bfd0869ee2
remove legacy code (#2084) 2 years ago
taobig c92400ead2
fix 当表有唯一键时,update()的形参和实参不一致 (#2010) 2 years ago
虫子樱桃 76086fc717
fix:typo in readme.md (#2061)
Co-authored-by: 虫子樱桃 <czyt@w.cn>
2 years ago
Kevin Wan 555c4ecd1a
fix: quickstart wrong package when go.mod exists in parent dir (#2048)
* chore: fix typo

* fix: quickstart in dir with go.mod

* fix: runner failed

* chore: refine code

* chore: simplify quickstart mono
2 years ago
Kevin Wan 38cd7b7df0
chore: remove lifecycle preStop because sh not exist in scratch (#2042) 2 years ago
anqiansong 93b3f5030f
chore: Add command desc & color commands (#2013)
* Add link & Color sub-commands

* Color sub-commands for unix-like OS

* Remove useless code

* Remove redundant dependency
2 years ago
anqiansong b44e8f5c75
fix #1977 (#2034) 2 years ago
anqiansong 9b6e4c440c
Add fig (#2008)
Co-authored-by: SH00414ml <sh00414ml@SH00414mldeMacBook-Pro.local>
2 years ago
Kevin Wan 9eea311a4d
feat: support build Dockerfile from current dir (#2021) 2 years ago
anqiansong c27e00b45c
feat: Replace mongo package with monc & mon (#2002)
* Replace mongo package with monc & mon

* Add terminal whitespace

* format code
2 years ago
swliao425 0f5d8c6be3
feat: add 'imagePullPolicy' parameter for 'goctl kube deploy' (#1996) 2 years ago
MarkJoyMa f2caf9237a
fix goctl api clone template fail (#1990) 2 years ago
Kevin Wan 2f0e4e3ebf
chore: update dependencies (#1985) 2 years ago
Kevin Wan 2c6b422f6b
chore: update goctl version to 1.3.8 (#1981) 3 years ago
Kevin Wan 4d34998338
fix: generate bad Dockerfile on given dir (#1980) 3 years ago
anqiansong 8be47b9c99
Fix pg subcommand level error (#1979) 3 years ago
Kevin Wan 7868bdf660
Chore/goctl version (#1962)
* chore: update version to v1.3.7

* docs: update migrate versions

* chore: remove debug prints

* chore: remove debug prints
3 years ago
Kevin Wan 46078e716d
chore: update version (#1961) 3 years ago
Kevin Wan 289a325757
chore: refine docker for better compatible with package main (#1944)
* chore: refine docker for better compatible with package main

* chore: default to current dir on goctl docker command
3 years ago
Kevin Wan 72ebbb9774
feat: update docker alpine package mirror (#1924)
* feat: update docker alpine package mirror

* chore: format code
3 years ago
anqiansong f1fdd55b38
Support built-in shorthand flags (#1925) 3 years ago
anqiansong 58787746db
fix: Useless delete cache logic in update (#1923)
* Fix bug: useless delete cache logic in update

* Format code
3 years ago
Kevin Wan 6b1e15cab1
chore: update k8s.io/client-go for security reason, go is upgrade to 1.16 (#1912)
* chore: fix jwt dependency security issue

* chore: update clickhouse driver

* chore: fix a security issue

* chore: update dependencies
3 years ago
anqiansong 5e7b1f6bfe
Fix process blocking problem during check (#1911) 3 years ago
Kevin Wan 7b82eda993
chore: use get for quickstart, plain logs for easy understanding (#1905) 3 years ago
Kevin Wan 5d09cd0e7c
use goproxy properly, remove files (#1903) 3 years ago
Kevin Wan c6e2b4a43a
chore: coding style for quickstart (#1902) 3 years ago
anqiansong 52f060caae
feat: Add goctl quickstart (#1889)
* Add goctl quickstart

* Format code

* Format code
3 years ago
anqiansong f486685e99
Fix code generation (#1897) 3 years ago
过客龙门 3ae874d75d
fix ts tpl (#1879) 3 years ago
givemeafish 14ca39bc86
fix:tools/goctl/rpc/generator/template_test.go file has wrong parameters (#1882) 3 years ago
Kevin Wan 5451d96a81
chore: update some logs (#1875) 3 years ago
anqiansong 5383e29ce6
feat: Replace cli to cobra (#1855)
* Replace cli

* Replace cli

* Replace cli

* Format code

* Add compare case

* Add compare case

* Add compare case

* Support go style flag

* Support go style flag

* Add test case
3 years ago
全自动盒子 ae2c76765c
fix typo (#1857) 3 years ago
Kevin Wan 3bbc90ec24
refactor: move json related header vars to internal (#1840)
* refactor: move json related header vars to internal

* refactor: use header.ContentType
3 years ago
Kevin Wan cef83efd4e
fix #1838 (#1839) 3 years ago
anqiansong cc09ab2aba
feat: Support model code generation for multi tables (#1836)
* Support model code generation for multi tables

* Format code

* Format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 5bcee4cf7c
fix #1806 (#1833)
* fix #1806

* chore: refine error text
3 years ago
anqiansong 16c61c6657
chore: Embed unit test data (#1812)
* Embed unit test data

* Add testdata

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
chowyu12 14bf2f33f7
add go-grpc_opt and go_opt for grpc new command (#1769)
Co-authored-by: zhouyy <zhouyy@ickey.cn>
3 years ago
anqiansong 305587aa81
fix: Fix issue #1810 (#1811)
* Fix #1810

* Remove go embed

* Format code

* Remove useless code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
fang duan bbe1249ecb
update rpc generate sample proto file (#1709)
* update rpc generate sample proto file

* update
3 years ago
Fyn e62870e268
feat(goctl): go work multi-module support (#1800)
* feat(goctl): go work multi-module support

Resolve: #1793

* chore: print log when getting project ctx fails
3 years ago
Fyn 036d803fbb
docs(goctl): goctl 1.3.4 migration note (#1780)
* docs(goctl): goctl 1.3.4 migration note

* adds a simple lang check
* adds migration notes

* chore: remove i18n

* chore: remove todo
3 years ago
Kevin Wan 9e20b1bbfe
chhore: fix usage typo (#1797) 3 years ago
fang duan fadef0ccd9
goctl api new should given a service_name explictly (#1688) 3 years ago
fang duan 4382ec0e0d
show help when running goctl api without any flags (#1678)
close #1676
3 years ago
fang duan db99addc64
show help when running goctl docker without any flags (#1679)
close #1677
3 years ago
fang duan 97bf3856c1
show help when running goctl rpc protoc without any flags (#1683) 3 years ago
fang duan ff6c6558dd
improve goctl rpc new (#1687) 3 years ago
Fyn ee88abce14
fix(goctl): api/new/api.tpl (#1788) 3 years ago
方航 fabea4c448
fix bug: crash when generate model with goctl. (#1777)
* fix bug: crash when generate model with goctl.

situation: column name with line.

CREATE TABLE test (
id int NOT NULL AUTO_INCREMENT,
zh-cn text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '中文简体',
PRIMARY KEY (id) USING BTREE,
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

* group imports

group imports

* Use

go-zero/tools/goctl/util/string.go
 func SafeString(in string) string {
instead of ReplaceAll

Co-authored-by: 方航 <fanghang@tange.ai>
3 years ago
Fyn 6d9dfc08f9
feat(goctl): supports api multi-level importing (#1747)
* feat(goctl): supports api  multi-level importing

Resolves: #1744

* fix(goctl): import-cycle, etc.

import-cycle will not be allowed
e.g., a.api -> b.api -> a.api
regular multiple-import will be allowed
e.g., a.api -> b.api -> c.api
                   -> c.api

* refactor(goctl): adds comments to exported var

* fix(goctl): typo in a comment
3 years ago
anqiansong 252fabcc4b
fix nil pointer if group not exists (#1773)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 415c4c91fc
fix: model unique keys generated differently in each re-generation (#1771) 3 years ago
fang duan 0cc9d4ff8d
show help when running goctl rpc template without any flags (#1685)
close #1684
3 years ago
anqiansong 8dd764679c
Fix #1765 (#1767)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 9fe868ade9
chore: remove legacy code (#1766) 3 years ago
Kevin Wan ab01442d46
add more tests (#1763)
* feat: add goctl docker build scripts

* chore: add more tests
3 years ago
Kevin Wan 8694e38384
feat: add goctl docker build scripts (#1760) 3 years ago
Kevin Wan faad6e27e3
feat: use go:embed to embed templates (#1756) 3 years ago
anqiansong 58a0b17451
Support `goctl env install` (#1752)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 89eccfdb97
chore: update go-zero to v1.3.2 in goctl (#1750) 3 years ago
Kevin Wan dfd58c213c
fix: model generation bug on with cache (#1743)
* fix: model generation bug on with cache

* chore: refine template

* chore: fix test failure
3 years ago
Kevin Wan 83cacf51b7
chore: update goctl version to 1.3.4 (#1742) 3 years ago
Kevin Wan 6dccfa29fd
feat: let model customizable (#1738) 3 years ago
anqiansong 7e0b0ab0b1
Fix zrpc code generation error with --remote (#1739)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan ac18cc470d
chore: refactor to use const instead of var (#1731) 3 years ago
Fyn f4471846ff
feat(goctl): supports model code 'DO NOT EDIT' (#1728)
Resolves: #1710
3 years ago
anqiansong 9c2d526a11
Fix unit test (#1730)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 2b9fc26c38
refactor: guard timeout on API files (#1726) 3 years ago
Xiaoju Jiang 321dc2d410
Added support for setting the parameter size accepted by the interface and custom timeout and maxbytes in API file (#1713)
* Added support for setting the parameter size accepted by the interface

* support custom timeout and maxbytes in API file

* support timeout used unit

* remove goctl maxBytes
3 years ago
Fyn 500bd87c85
fix(goctl): api format with reader input (#1722)
resolves #1721
3 years ago
Kevin Wan 3febb1a5d0
chore: refactor code (#1700) 3 years ago
Mikael d8054d8def
fix -cache=true insert no clean cache (#1672)
* fix -cache=true insert no clean cache

* fix -cache=true insert no clean cache
3 years ago
anqiansong 0aeb49a6b0
Add verbose flag (#1696)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 5c169f4f49
Remove debug log (#1669)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan d29dfa12e3
feat: support -base to specify base image for goctl docker (#1668)
* feat: support -base to specify base image for goctl docker

* chore: update usage
3 years ago
anqiansong 194f55e08e
Remove unused code (#1667)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan c0f9892fe3
feat: add Dockerfile for goctl (#1666) 3 years ago
anqiansong 227104d7d7
feat: Remove command `goctl rpc proto` (#1665)
* Fix goctl completion expression

* Fix code generation error if the pkg of pb/grpc is same to zrpc call client pkg

* Remove deprecated comment on action goctl rpc new

* Remove zrpc code generation on action goctl rpc proto

* Remove zrpc code generation on action goctl rpc proto

* Remove Generator interface

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 448029aa4b
Mkdir if not exists (#1659)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Fyn 17e0afeac0
fix(goctl): model method FindOneCtx should be FindOne (#1656) 3 years ago
ronething-bot 18916b5189
[fix] typo (#1655) 3 years ago
Kevin Wan c11a09be23
chore: remove unnecessary env (#1654) 3 years ago
ronething-bot 56e1ecf2f3
fix: typo (#1646) 3 years ago
xybingbing 09e6d94f9e
FindOneBy 漏 Context (#1642) 3 years ago
anqiansong cc9d16f505
fix: Update unix-like path regex (#1637)
* Revert import value regex

* Update linux path regex

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
chensy c55694d957
Support for referencing types in different API files using format (#1630) 3 years ago
Ziyi Zhang 209ffb934b
fix(goctl): kotlin code generation (#1632)
Signed-off-by: Ziyi Zhang <soasurs@gmail.com>
3 years ago
Kevin Wan 26a33932cd
feat: support scratch as the base docker image (#1634) 3 years ago
Kevin Wan d6a692971f
chore: reduce the docker image size (#1633)
* chore: reduce the docker image size

* chore: format dockerfile
3 years ago
anqiansong 4624390e54
Fix #1585 #1547 (#1624) 3 years ago
Kevin Wan 63b7d292c1
chore: update goctl version to 1.3.3, change docker build temp dir (#1621) 3 years ago
Fyn 365c569d7c
fix(goctl): dart gen user defined struct array (#1620) 3 years ago
anqiansong 68a81fea8a
Fix #1609 (#1617) 3 years ago
anqiansong 08a8bd7ef7
Fix #1614 (#1616) 3 years ago
Kevin Wan 3b7ca86e4f
chore: add unit tests (#1615)
* test: add more tests

* test: add more tests
3 years ago
Fyn 0c35f39a7d
fix: fix(gctl): apiparser_parser auto format (#1607) 3 years ago
Fyn 6a66dde0a1
feat(goctl): api dart support flutter v2 (#1603)
0. support null-safety code gen
1. supports -legacy flag for legacy code gen
2. supports -hostname flag for server hostname
3. use dart official format
4. fix some some bugs

Resolves: #1602
3 years ago
Kevin Wan f15a4f9188
chore: update go-zero to v1.3.1 in goctl (#1599) 3 years ago
Kevin Wan e31128650e
Revert "🐞 fix(gen): pg gen of insert (#1591)" (#1598)
This reverts commit cc4c4928e0.
3 years ago
toutou_o cc4c4928e0
🐞 fix(gen): pg gen of insert (#1591)
Co-authored-by: kurimi1 <d0n41df@gmail.com>
3 years ago
Fyn fba6543b23
fix: goctl api dart support `form` tag (#1596) 3 years ago
Kevin Wan 259a5a13e7
chore: fix data race (#1593) 3 years ago
Fyn cf7c7cb392
build: update goctl dependency ddl-parser to v1.0.3 (#1586)
* build: update goctl dependency ddl-parser to v1.0.3

* fix: race condition when testing logx

Resolves: #1587
3 years ago
anqiansong ffd69a2f5e
Fix bug int overflow while build goctl on arch 386 (#1582)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 66f10bb5e6
chore: add goctl command help (#1578) 3 years ago
Fyn db949e40f1
feat: supports `importValue` for more path formats (#1569)
`importValueRegex` now can match more path formats

Resolves: #1568
3 years ago
Kevin Wan e0454138e0
update goctl to go 1.16 for io/fs usage (#1571)
* update goctl to go 1.16 for io/fs usage

* feat: support pg serial type for auto_increment (#1563)

* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>

* chore: format code

Co-authored-by: toutou_o <33993460+kurimi1@users.noreply.github.com>
Co-authored-by: kurimi1 <d0n41df@gmail.com>
3 years ago
toutou_o 3b07ed1b97
feat: support pg serial type for auto_increment (#1563)
* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>
3 years ago
anqiansong daa98f5a27
Feature: Add goctl env (#1557) 3 years ago
Kevin Wan aa29036cb3
feat: support ctx in sql model generation (#1551) 3 years ago
Kevin Wan 607bae27fa
feat: support ctx in sqlx/sqlc, listed in ROADMAP (#1535)
* feat: support ctx in sqlx/sqlc

* chore: update roadmap

* fix: context.Canceled should be acceptable

* use %w to wrap errors

* chore: remove unused vars
3 years ago
Kevin Wan bd105474ca
chore: update help message (#1544) 3 years ago
Mikael a078f5d764
add the serviceAccount of deployment (#1543)
Co-authored-by: 977231903@qq.com <>
3 years ago
mlr3000 50b1928502
chore:use struct pointer (#1538) 3 years ago
Kevin Wan 6deb80625d
fix issue of default migrate version (#1536)
* fix issue of default migrate version

* chore: update console colors
3 years ago
Kevin Wan 84ddc660c4
chore: goctl format issue (#1531) 3 years ago
Kevin Wan 0ce85376bf
chore: update goctl version to 1.3.2 (#1524) 3 years ago
Kevin Wan a40254156f
refactor: refactor yaml unmarshaler (#1517) 3 years ago
Kevin Wan 822ee2e1c5
feat: update go-redis to v8, support ctx in redis methods (#1507)
* feat: update go-redis to v8, support ctx in redis methods

* fix compile errors

* chore: remove unused const

* chore: add tracing log on redis
3 years ago
anqiansong 77482c8946
fixes typo (#1511)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 8bd89a297a
feature: Add `goctl completion` (#1505)
* feature: Add `goctl completion`

* Update const

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong b1ffc464cd
fix typo: goctl protoc usage (#1502)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 50174960e4
chore: update command comment (#1501) 3 years ago
Kevin Wan 8f46eab977
fix: goctl not compile on windows (#1500) 3 years ago
Kevin Wan ec299085f5
docs: update tal-tech to zeromico in docs (#1498) 3 years ago
Kevin Wan 7727d70634
chore: update goctl version (#1497) 3 years ago
Kevin Wan 6f4b97864a
chore: improve migrate confirmation (#1488) 3 years ago
Kevin Wan 0e0abc3a95
chore: update warning message (#1487) 3 years ago
anqiansong 696fda1db4
patch: goctl migrate (#1485)
* * Add signal check
* Add deprecated pkg check

* fix typo `replacementBuilderx`

* output to console if verbose

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan c1d2634427
chore: update go version for goctl (#1484) 3 years ago
Kevin Wan 4b7a680ac5
refactor: rename from tal-tech to zeromicro for goctl (#1481) 3 years ago
anqiansong cdf7ec213c
fix #1468 (#1478)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong df0f8ed59e
Fix/issue#1289 (#1460)
* fix #1289

* Add unit test case

* fix `jwtTransKey`

* fix `jwtTransKey`

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong c903966fc7
patch: save missing templates to disk (#1463)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong e57fa8ff53
Fix/issue#1447 (#1458)
* Add data for template to render

* fix #1447

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 9b592b3dee
Feature rpc protoc (#1251)
* code generation by protoc

* generate pb by protoc direct

* support: grpc code generation by protoc directly

* format code

* check --go_out & --go-grpc_out

* fix typo

* Update version

* fix typo

* optimize: remove deprecated unit test

* format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
spectatorMrZ 240132e7c7
Fix pg model generation without tag (#1407)
1. fix pg model struct haven't tag
2. add pg command test from datasource
3 years ago
anqiansong 9d67fc4cfb
feat: Add migrate (#1419)
* Add migrate

* Remove unused module

* refactor filename

* rename refactor to migrate

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 892f93a716
docs: update install readme (#1417) 3 years ago
Kevin Wan a91c3907a8
feat: rename module from tal-tech to zeromicro (#1413) 3 years ago
Kevin Wan e267d94ee1
chore: update go-zero to v1.2.5 (#1410) 3 years ago
anqiansong 89ce5e492b
refactor file|path (#1409)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 7cc64070b1
docs: update goctl installation command (#1403) 3 years ago
anqiansong 8e9110cedf
fix #1330 (#1382)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan d6ff30a570
chore: fix golint issues (#1396) 3 years ago
Kevin Wan b98d46bfd6
chore: update goctl version (#1394) 3 years ago
Kevin Wan c6eb1a9670
ci: remove windows 386 binary (#1392)
* ci: remove windows 386 binary

* chore: update go-zero

* chore: update go-zero
3 years ago
Kevin Wan 62266d8f91
fix #1070 (#1389)
* fix #1070

* test: add more tests
3 years ago
anqiansong b8ea16a88e
feat: Add --remote (#1387)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 49bab23c54
fix #1376 (#1380)
* fix #1376

* fix #1376

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Leizhengzi 78ba00d3a7
fix: command system info missing go version (#1377) 3 years ago
Kevin Wan f827a7b985
chore: update goctl version to 1.2.4 for release tools/goctl/v1.2.4 (#1372) 3 years ago
行者 f5f2097d14
Updated MySQL生成表结构体遇到关键字db部分保持原字段名定义 (#1369) 3 years ago
Kevin Wan 1d223fc114
docs: update goctl markdown (#1370) 3 years ago
JiangYiJun a67c118dcf
go-zero tools ,fix a func,api new can not choose style (#1356) 3 years ago
Kevin Wan cd289465fd
chore: coding style and comments (#1361)
* chore: coding style and comments

* chore: optimize `ParseJsonBody` (#1353)

* chore: optimize `ParseJsonBody`

* chore: optimize `ParseJsonBody`

* fix: fix a test

* chore: optimize `ParseJsonBody`

* fix a test

* chore: add comment

* chore: refactor

Co-authored-by: chenquan <chenquan.dev@foxmail.com>
3 years ago
Kevin Wan 8fd16c17dc
chore: update goctl version to 1.2.5 (#1337) 3 years ago
anqiansong 5979b2aa0f
Update template (#1335)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 0b17e0e5d9
Feat goctl bug (#1332)
* Support goctl bug

* fix typo

* format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 3d8ad5e4f6
feat: tidy mod, update go-zero to latest (#1334) 3 years ago
Kevin Wan ff1752dd39
feat: tidy mod, update go-zero to latest (#1333) 3 years ago
Kevin Wan 1becaeb7be
chore: refactor (#1331) 3 years ago
yangkequn 171afaadb9
Update types.go (#1314) 3 years ago
Kevin Wan 776e6e647d
feat: tidy mod, add go.mod for goctl (#1328) 3 years ago
Kevin Wan 490ef13822
style: format code (#1322) 3 years ago
anqiansong 1b14de2ff9
fix: #1318 (#1321)
* fix #1318

* fix #1318

* remove never used code

* fix unit tes

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
anqiansong 07191dc430
fix #1305 (#1307)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 0240fa131a
chore: rename service context from ctx to svcCtx (#1299) 3 years ago
Kevin Wan 8086ad120b
Revert "feat: reduce dependencies of framework by add go.mod in goctl (#1290)" (#1291)
This reverts commit 87a445689c.
3 years ago
Kevin Wan 87a445689c
feat: reduce dependencies of framework by add go.mod in goctl (#1290) 3 years ago
Kevin Wan b6bda54870
chore: update cli version (#1287) 3 years ago
Kevin Wan 543d590710
fixes #987 (#1283)
* fixes #987

* chore: fix test failure

* chore: add comments
3 years ago
anqiansong f1d70eb6b2 Feature api root path (#1261) 3 years ago
Kevin Wan 86f9f63b46
Cli (#1272)
* Fix issue 1260 (#1262)

* Fix #1238 (#1266)

* docs: update readme to use goctl@cli (#1255)

* chore: update goctl version

* style: coding style

* docs: update readme to use goctl@cli

* fix #1238

* format code

* format code

Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
Co-authored-by: anqiansong <anqiansong@bytedance.com>

Co-authored-by: anqiansong <anqiansong@gmail.com>
Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 417a96cbf2
chore: update goctl version (#1250)
* chore: update goctl version

* style: coding style
3 years ago
anqiansong b0573af9a9
Update template (#1243) 3 years ago
anqiansong 0cb86c6990
reset link goctl (#1232) 3 years ago
Kevin Wan fa0c364982
fixes #1169 (#1229) 3 years ago
Kevin Wan a6c8113419
chore: refactor, better goctl message (#1228) 3 years ago
Kevin Wan d3bfa16813
feat: exit with non-zero code on errors (#1218)
* feat: exit with non-zero code on errors

* chore: use const for code
3 years ago
Kevin Wan f8367856e8
chore: refine code (#1215) 3 years ago
anqiansong 69a4d213a3
Fix issue 1205 (#1211)
* fix #1205

* move builder into stores

* remove xrom

* Remove unused code

* Remove unused code

* refactor builderx to builder

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan c28e01fed3
feat: support CORS by using rest.WithCors(...) (#1212)
* feat: support CORS by using rest.WithCors(...)

* chore: add comments

* refactor: lowercase unexported methods

* ci: fix lint errors
3 years ago
Kevin Wan 4d22b0c497
feat: ignore rest.WithPrefix on empty prefix (#1208) 3 years ago
晨曦中 539215d7df
goctl docker command add -version (#1206)
* feature(优化): 优化goctl

goctl docker 命令新增version参数,指定builder golang 版本

* feature(优化): 优化goctl

goctl docker 命令新增version参数,指定builder golang 版本
3 years ago
anqiansong 01786c5e63
Generate route with prefix (#1200)
* Generate route with prefix

* Update api convert

* Remove TrimSpace

* Update path join

* Format code

* Format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan b76c7ae55d
chore: remove semicolon for routes of services in api files (#1195) 3 years ago
Kevin Wan 7e3fe77e7b
chore: update goctl version to 1.2.3, prepare for release (#1193)
* feat: slow threshold customizable in rest

* chore: update goctl version to 1.2.3, prepare for release
3 years ago
anqiansong bef5bd4e4f
fix the package name of grpc client (#1170)
* fix the package name of grpc client

* Remove k8s/utils

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
zeromake 9fd3f752d1
fix(goctl): repeat creation protoc-gen-goctl symlink (#1162) 3 years ago
anqiansong 9c48e9ceab
Feature add template version (#1152) 3 years ago
anqiansong a944a7fd7e
Mark deprecated syntax (#1148) 3 years ago
anqiansong 44202acb18
Fix issue #1127 (#1131)
* fix #1127

* fix #1127

* fixed unit test

* add go keyword converter

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 6a8638fc85
chore: refine rpc template in goctl (#1129) 3 years ago
chenquan d28cfe5f20
Add `opts ...grpc.CallOption` in grpc client (#1122)
* Add `opts ...grpc.CallOption` in grpc client

* Update format

* Update format

* Add import package

* Update format
3 years ago
Kevin Wan 426b09c356
update goctl version to 1.2.2 (#1125) 3 years ago
Kevin Wan ed15ca04f4
fix: opentelemetry traceid not correct (#1108) 3 years ago
小小小下 295ec27e1b
feat: reflection grpc service (#1107)
* feat: reflection grpc service

* feat: reflection grpc service
3 years ago
理工男 8d2db09d45
Update Makefile (#1098) 3 years ago
Kevin Wan 65905b914d
ci: add reviewdog (#1096) 3 years ago
z-micro 80e3407be1
fix bug: generating dart code error (#1090) 3 years ago
Amor 41c980f00c
update goctl api (#1052)
* update goctl api

* add LoadTemplate

* update new api template

* update
3 years ago
shenbaise9527 f34d81ca2c
chore: when run goctl-rpc, the order of proto message aliases should be (#1078)
fixed

Co-authored-by: steven <steven.zhou@1quant.com>
3 years ago
Kevin Wan 2e12cd2c99
coding style (#1083) 3 years ago
anqiansong e8a340c1c0
Create a symbol link file named protoc-gen-goctl from goctl (#1076) 3 years ago
anqiansong 9a724fe907
Add MustTempDir (#1069) 3 years ago
anqiansong 7fb5bab26b
fix #1058 (#1064) 3 years ago
Jerry Liang 5c6a3132eb
fix typo parse.go error message (#1041) 3 years ago
Kevin Wan 2bd95aa007
update goctl version to 1.2.1 (#1042) 3 years ago
Kevin Wan e8376936d5
remove goctl config command (#1035) 3 years ago
Kevin Wan 71c0288023
fix symlink issue on windows for goctl (#1034)
* fix symlink issue on windows for goctl

* move readlink into separate file
3 years ago
Kevin Wan 0b6bc69afa
reorg imports, format code (#1024) 3 years ago
anqiansong ded22e296e revert changes 3 years ago
anqiansong f0ed2370a3
fix #1014 (#1018)
* fix #1014

* remove unused code

* * optimize generate pb.go on Windows
* format code
* optimize console.go

* version rollback

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan f6d9e19ecb
expose sql.DB to let orm operate on it (#1015)
* expose sql.DB to let orm operate on it

* add missing RawDB methods

* add NewSqlConnFromDB for cooperate with dtm
3 years ago
Kevin Wan 56807aabf6
fix golint issues, update codecov settings. (#1011)
* update codecov settings

* fix golint issues
3 years ago
Kevin Wan 96a35ecf1a
fix #1006 (#1008)
* use sdktrace instead of trace for opentelemetry to avoid conflicts

* disable opentelemetry for right now

* use os.ModeSymlink instead of fs.ModeSymlink for backward compatibility
3 years ago
Kevin Wan bdec5f2349
use sdktrace instead of trace for opentelemetry to avoid conflicts (#1005)
* use sdktrace instead of trace for opentelemetry to avoid conflicts

* disable opentelemetry for right now
3 years ago
shenbaise9527 bc92b57bdb
api文件中使用group时生成的handler和logic的包名应该为group的名字 (#545)
* api文件中使用group时生成的handler和logic的包名应该为group的名字

* Update genhandlers.go

fix errors.

Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
3 years ago
neosu d8905b9e9e
add api template file (#1003) 3 years ago
Kevin Wan 10805577f5
reorg imports, format code (#1000) 3 years ago
anqiansong 84d2b64e7c
optimize unit test (#999) 3 years ago
toven tang d179b342b2
修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。 (#960)
* 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。

* 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。

Co-authored-by: toven <toven@advan.onaliyun.com>
3 years ago
anqiansong 8829c31c0d
Feature goctl error wrap (#995)
* Add `Wrap` in file errorx.go

* Wrap error with `GoctlError`

* format code

* Refactor package `env` to `version`

* Refactor package `IsVersionGatherThan`

* fix typo

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan 0325d8e92d
format code, and reorg imports (#991) 3 years ago
anqiansong 2125977281
Fix filepath (#990) 3 years ago
Vee Zhang c26c187e11
remote handler blank line when .HasRequest is false (#986) 3 years ago
miaogaolin 423955c55f
format code (#979) 3 years ago
Kevin Wan 7618139dad
refactor (#977) 3 years ago
Kevin Wan 519db812b4
format coding style (#969) 3 years ago
anqiansong 3203f8e06b
Fix issues (#965) 3 years ago
chenquan b71ac2042a
Add a test case for database code generation `tool` (#961) 3 years ago
Kevin Wan bf3ce16823
fix #820 (#934) 3 years ago
anqiansong 189721da16
Fix issues (#931)
* fix #929

* fix #925

* add test case

* update model README

* fix #929

* fix #929

* fix #929

* refactor dir

* Adding todo comments

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
3 years ago
anqiansong b2fea65faa
Optimize model naming (#910)
* add unit test

* fix #907

* format code

* format code

* format code

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
3 years ago
anqiansong a1fe8bf6cd
fix missing `updateMethodTemplateFile` (#924) 3 years ago
Kevin Wan 9c1ee50497
refactor (#920) 3 years ago
anqiansong 14ec29991c
fix #915 (#917) 3 years ago