Skip to content

Commit

Permalink
Version/v2.6.0 beta (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Dec 4, 2023
1 parent 0b6dd6f commit ee2cf92
Show file tree
Hide file tree
Showing 39 changed files with 128 additions and 90 deletions.
14 changes: 7 additions & 7 deletions cmd/gf/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/gogf/gf/cmd/gf/v2
go 1.18

require (
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.7
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.6.0-beta
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.6.0-beta
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.6.0-beta
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.6.0-beta
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.6.0-beta
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.6.0-beta
github.com/gogf/gf/v2 v2.6.0-beta
github.com/minio/selfupdate v0.6.0
github.com/olekukonko/tablewriter v0.0.5
golang.org/x/mod v0.9.0
Expand Down
14 changes: 0 additions & 14 deletions cmd/gf/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@ github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.6 h1:yziPSf9AycEWphv9WiNjcRAVPOJtUauMMvP6pHQB4jY=
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.6/go.mod h1:yOlpwhFXgW+P2sf4goA20PUtxdVLliBx4dJRyJeOtto=
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.6 h1:LGQIe5IvYVr4hZ/vUAFiqWssxE7QeILyVPJ9swo1Cmk=
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.6/go.mod h1:EcF8v8jqCV61/YqN6DXxdo3kh8waGmEj6WpFqbLkkrM=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.6 h1:oR9F4LVoKa/fjf/o6Y/CQRNiYy35Bszo07WwvMWYMxo=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.6/go.mod h1:gvHSRqCpv2c+N0gDHsEldHgU/yM9tcCBdIEKZ32/TaE=
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.6 h1:3Y3lEoO9SoG1AmfaKjgTsDt93+T2q/qTMog8wBvIIGM=
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.6/go.mod h1:cR3lFoU6ZtSaMQ3DpCJwWnYW6EvHPYGGeqv/kzgH4gw=
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.6 h1:0WHVzqITqIBu/NNPXt3tN2eiWAGiNjs9sg6wh+WbUvY=
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.6/go.mod h1:qZCTNQ0n2gHcuBwM9wUl3pelync3xK0gTnChJZD6f0I=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.6 h1:6clfLvFoHXHdw+skmXg4yxw+cLwgAG8gRiS/6f9Y9Xc=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.6/go.mod h1:QV6Rrj+4G4OaJVkP9XXRZ1LWL+ls6qH7ebeMcxsulqA=
github.com/gogf/gf/v2 v2.5.6 h1:a1UK1yUP3s+l+vPxmV91+8gTarAP9b1IEOw0W7LNl6E=
github.com/gogf/gf/v2 v2.5.6/go.mod h1:17K/gBYrp0bHGC3XYC7bSPoywmZ6MrZHrZakTfh4eIQ=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
Expand Down
16 changes: 10 additions & 6 deletions cmd/gf/internal/cmd/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ func init() {
type (
cRunInput struct {
g.Meta `name:"run"`
File string `name:"FILE" arg:"true" brief:"{cRunFileBrief}" v:"required"`
Path string `name:"path" short:"p" brief:"{cRunPathBrief}" d:"./"`
Extra string `name:"extra" short:"e" brief:"{cRunExtraBrief}"`
Args string `name:"args" short:"a" brief:"{cRunArgsBrief}"`
WatchPaths string `name:"watchPaths" short:"w" brief:"{cRunWatchPathsBrief}"`
File string `name:"FILE" arg:"true" brief:"{cRunFileBrief}" v:"required"`
Path string `name:"path" short:"p" brief:"{cRunPathBrief}" d:"./"`
Extra string `name:"extra" short:"e" brief:"{cRunExtraBrief}"`
Args string `name:"args" short:"a" brief:"{cRunArgsBrief}"`
WatchPaths []string `name:"watchPaths" short:"w" brief:"{cRunWatchPathsBrief}"`
}
cRunOutput struct{}
)
Expand All @@ -97,12 +97,16 @@ func (c cRun) Index(ctx context.Context, in cRunInput) (out *cRunOutput, err err
mlog.Fatalf(`command "go" not found in your environment, please install golang first to proceed this command`)
}

if len(in.WatchPaths) == 1 {
in.WatchPaths = strings.Split(in.WatchPaths[0], ",")
}

app := &cRunApp{
File: in.File,
Path: in.Path,
Options: in.Extra,
Args: in.Args,
WatchPaths: strings.Split(in.WatchPaths, ","),
WatchPaths: in.WatchPaths,
}
dirty := gtype.NewBool()
_, err = gfsnotify.Add(gfile.RealPath("."), func(event *gfsnotify.Event) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gf/internal/cmd/genctrl/genctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type (
SdkStdVersion bool `short:"v" name:"sdkStdVersion" brief:"{CGenCtrlBriefSdkStdVersion}" orphan:"true"`
SdkNoV1 bool `short:"n" name:"sdkNoV1" brief:"{CGenCtrlBriefSdkNoV1}" orphan:"true"`
Clear bool `short:"c" name:"clear" brief:"{CGenCtrlBriefClear}" orphan:"true"`
Merge bool `short:"m" name:"merge" brief:"{CGenCtrlControllerMerge}" orphan:"true"`
Merge bool `short:"m" name:"merge" brief:"{CGenCtrlControllerMerge}" orphan:"true"`
}
CGenCtrlOutput struct{}
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/apollo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/apolloconfig/agollo/v4 v4.3.1
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/consul/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/consul/v2
go 1.19

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/hashicorp/consul/api v1.24.0
github.com/hashicorp/go-cleanhttp v0.5.2
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/kubecm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/kubecm/v2
go 1.19

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
k8s.io/api v0.27.4
k8s.io/apimachinery v0.27.4
k8s.io/client-go v0.27.4
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/nacos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/nacos/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/nacos-group/nacos-sdk-go v1.1.4
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/config/polaris/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/polaris/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/polarismesh/polaris-go v1.5.5
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/clickhouse/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/ClickHouse/clickhouse-go/v2 v2.0.15
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/google/uuid v1.3.0
github.com/shopspring/decimal v1.3.1
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/dm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/gogf/gf/v2 => ../../../

require (
gitee.com/chunanyong/dm v1.8.12
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/mssql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/denisenkom/go-mssqldb v0.12.3
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/mysql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/go-sql-driver/mysql v1.7.1
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/oracle/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/oracle/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/sijms/go-ora/v2 v2.7.10
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/pgsql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/pgsql/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/lib/pq v1.10.9
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/sqlite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/glebarez/go-sqlite v1.21.2
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/sqlitecgo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/sqlitecgo/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/mattn/go-sqlite3 v1.14.17
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/nosql/redis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/nosql/redis/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/redis/go-redis/v9 v9.2.1
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/trace v1.14.0
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/etcd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/etcd/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
go.etcd.io/etcd/client/v3 v3.5.7
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/file/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/gogf/gf/contrib/registry/file/v2

go 1.18

require github.com/gogf/gf/v2 v2.5.7
require github.com/gogf/gf/v2 v2.6.0-beta

require (
github.com/BurntSushi/toml v1.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/nacos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/nacos/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/polaris/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/polaris/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
github.com/polarismesh/polaris-go v1.5.5
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/zookeeper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/go-zookeeper/zk v1.0.3
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
golang.org/x/sync v0.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions contrib/rpc/grpcx/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/gogf/gf/contrib/rpc/grpcx/v2
go 1.18

require (
github.com/gogf/gf/contrib/registry/file/v2 v2.5.7
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/contrib/registry/file/v2 v2.6.0-beta
github.com/gogf/gf/v2 v2.6.0-beta
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/trace v1.14.0
google.golang.org/grpc v1.57.2
Expand Down
49 changes: 36 additions & 13 deletions contrib/rpc/grpcx/grpcx_grpc_server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package grpcx

import (
"context"

"google.golang.org/grpc"

"github.com/gogf/gf/v2/frame/g"
Expand All @@ -18,18 +17,41 @@ import (

// GrpcServerConfig is the configuration for server.
type GrpcServerConfig struct {
Address string // (optional) Single address for server listening, use `:0` or `ip:0` to serve random port.
Name string // (optional) Name for current service.
Logger *glog.Logger // (optional) Logger for server.
LogPath string // (optional) LogPath specifies the directory for storing logging files.
LogStdout bool // (optional) LogStdout specifies whether printing logging content to stdout.
ErrorStack bool // (optional) ErrorStack specifies whether logging stack information when error.
ErrorLogEnabled bool // (optional) ErrorLogEnabled enables error logging content to files.
ErrorLogPattern string // (optional) ErrorLogPattern specifies the error log file pattern like: error-{Ymd}.log
AccessLogEnabled bool // (optional) AccessLogEnabled enables access logging content to file.
AccessLogPattern string // (optional) AccessLogPattern specifies the error log file pattern like: access-{Ymd}.log
Endpoints []string // (optional) Endpoints are custom endpoints for service register, it uses Address if empty.
Options []grpc.ServerOption // (optional) GRPC Server options.
// (optional) Name for current service.
Name string

// (optional) Single address for server listening, use `:0` or `ip:0` to serve random port.
Address string

// (optional) Logger for server.
Logger *glog.Logger

// (optional) LogPath specifies the directory for storing logging files.
LogPath string

// (optional) LogStdout specifies whether printing logging content to stdout.
LogStdout bool

// (optional) ErrorStack specifies whether logging stack information when error.
ErrorStack bool

// (optional) ErrorLogEnabled enables error logging content to files.
ErrorLogEnabled bool

// (optional) ErrorLogPattern specifies the error log file pattern like: error-{Ymd}.log
ErrorLogPattern string

// (optional) AccessLogEnabled enables access logging content to file.
AccessLogEnabled bool

// (optional) AccessLogPattern specifies the error log file pattern like: access-{Ymd}.log
AccessLogPattern string

// (optional) Endpoints are custom endpoints for service register, it uses Address if empty.
Endpoints []string

// (optional) GRPC Server options.
Options []grpc.ServerOption
}

// NewConfig creates and returns a ServerConfig object with default configurations.
Expand All @@ -51,6 +73,7 @@ func (s modServer) NewConfig() *GrpcServerConfig {
)
// Reading configuration file and updating the configured keys.
if g.Cfg().Available(ctx) {
// Server attributes configuration.
if err = g.Cfg().MustGet(ctx, configNodeNameGrpcServer).Struct(&config); err != nil {
g.Log().Error(ctx, err)
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/sdk/httpclient/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/gogf/gf/contrib/sdk/httpclient/v2

go 1.18

require github.com/gogf/gf/v2 v2.5.7
require github.com/gogf/gf/v2 v2.6.0-beta

require (
github.com/BurntSushi/toml v1.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion contrib/trace/jaeger/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/jaeger/v2
go 1.18

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/exporters/jaeger v1.14.0
go.opentelemetry.io/otel/sdk v1.14.0
Expand Down
2 changes: 1 addition & 1 deletion contrib/trace/otlpgrpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/otlpgrpc/v2
go 1.20

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
Expand Down
2 changes: 1 addition & 1 deletion contrib/trace/otlphttp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/otlphttp/v2
go 1.20

require (
github.com/gogf/gf/v2 v2.5.7
github.com/gogf/gf/v2 v2.6.0-beta
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0
Expand Down
10 changes: 8 additions & 2 deletions errors/gerror/gerror_api_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type Option struct {
Code gcode.Code // Error code if necessary.
}

// NewOption creates and returns a custom error with Option.
// NewWithOption creates and returns a custom error with Option.
// It is the senior usage for creating error, which is often used internally in framework.
func NewOption(option Option) error {
func NewWithOption(option Option) error {
err := &Error{
error: option.Error,
text: option.Text,
Expand All @@ -29,3 +29,9 @@ func NewOption(option Option) error {
}
return err
}

// NewOption creates and returns a custom error with Option.
// Deprecated: use NewWithOption instead.
func NewOption(option Option) error {
return NewWithOption(option)
}
Loading

0 comments on commit ee2cf92

Please sign in to comment.