mirror of
https://gitee.com/johng/gf
synced 2026-07-07 06:15:15 +08:00
add golangci feature to guarantee codes quality (#2229)
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
package boot
|
||||
|
||||
import (
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
"github.com/gogf/gf/contrib/config/kubecm/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -2,6 +2,7 @@ package nacos
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/example/config/nacos/boot"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
@ -2,6 +2,7 @@ package polaris
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/example/config/polaris/boot"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
@ -9,6 +9,7 @@ import (
|
||||
type Req struct {
|
||||
g.Meta `path:"/user" method:"get"`
|
||||
}
|
||||
|
||||
type Res []Item
|
||||
|
||||
type Item struct {
|
||||
|
||||
@ -12,6 +12,7 @@ type HelloReq struct {
|
||||
g.Meta `path:"/hello" method:"get" sort:"1"`
|
||||
Name string `v:"required" dc:"Your name"`
|
||||
}
|
||||
|
||||
type HelloRes struct {
|
||||
Reply string `dc:"Reply content"`
|
||||
}
|
||||
|
||||
@ -5,13 +5,12 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/polarismesh/polaris-go/api"
|
||||
"github.com/polarismesh/polaris-go/pkg/config"
|
||||
|
||||
"github.com/gogf/gf/contrib/registry/polaris/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/gsvc"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/polarismesh/polaris-go/api"
|
||||
"github.com/polarismesh/polaris-go/pkg/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@ -3,13 +3,12 @@ package main
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/polarismesh/polaris-go/api"
|
||||
"github.com/polarismesh/polaris-go/pkg/config"
|
||||
|
||||
"github.com/gogf/gf/contrib/registry/polaris/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/net/gsvc"
|
||||
"github.com/polarismesh/polaris-go/api"
|
||||
"github.com/polarismesh/polaris-go/pkg/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@ -2,10 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/gtrace"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/gogf/katyusha/krpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcache"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/katyusha/krpc"
|
||||
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
)
|
||||
|
||||
type server struct{}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@ -46,6 +46,7 @@ func main() {
|
||||
type InsertReq struct {
|
||||
Name string `v:"required#Please input user name."`
|
||||
}
|
||||
|
||||
type InsertRes struct {
|
||||
Id int64
|
||||
}
|
||||
@ -66,6 +67,7 @@ func (c *cTrace) Insert(ctx context.Context, req *InsertReq) (res *InsertRes, er
|
||||
type QueryReq struct {
|
||||
Id int `v:"min:1#User id is required for querying"`
|
||||
}
|
||||
|
||||
type QueryRes struct {
|
||||
User gdb.Record
|
||||
}
|
||||
@ -90,6 +92,7 @@ func (c *cTrace) Query(ctx context.Context, req *QueryReq) (res *QueryRes, err e
|
||||
type DeleteReq struct {
|
||||
Id int `v:"min:1#User id is required for deleting."`
|
||||
}
|
||||
|
||||
type DeleteRes struct{}
|
||||
|
||||
// Delete is a route handler for deleting specified user info.
|
||||
|
||||
Reference in New Issue
Block a user