Skip to content

Commit aae9141

Browse files
committed
refactor: update code
1 parent b1641fe commit aae9141

File tree

12 files changed

+764
-188
lines changed

12 files changed

+764
-188
lines changed

cmd/onex-cacheserver/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type ServerOptions struct {
2626
Logging *log.Options `json:"log" mapstructure:"log"`
2727
}
2828

29-
// Ensure ServerOptions implements the app.CliOptions interface.
30-
var _ app.CliOptions = (*ServerOptions)(nil)
29+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
30+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
3131

3232
// NewServerOptions creates a ServerOptions instance with default values.
3333
func NewServerOptions() *ServerOptions {

cmd/onex-gateway/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ type ServerOptions struct {
4848
Log *log.Options `json:"log" mapstructure:"log"`
4949
}
5050

51-
// Ensure ServerOptions implements the app.CliOptions interface.
52-
var _ app.CliOptions = (*ServerOptions)(nil)
51+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
52+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
5353

5454
// NewServerOptions creates a ServerOptions instance with default values.
5555
func NewServerOptions() *ServerOptions {

cmd/onex-nightwatch/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ type ServerOptions struct {
4747
Log *log.Options `json:"log" mapstructure:"log"`
4848
}
4949

50-
// Ensure ServerOptions implements the app.CliOptions interface.
51-
var _ app.CliOptions = (*ServerOptions)(nil)
50+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
51+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
5252

5353
// NewServerOptions creates a ServerOptions instance with default values.
5454
func NewServerOptions() *ServerOptions {

cmd/onex-pump/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ type ServerOptions struct {
3131
FeatureGates map[string]bool `json:"feature-gates"`
3232
}
3333

34-
// Ensure ServerOptions implements the app.CliOptions interface.
35-
var _ app.CliOptions = (*ServerOptions)(nil)
34+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
35+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
3636

3737
// NewServerOptions creates a ServerOptions instance with default values.
3838
func NewServerOptions() *ServerOptions {

cmd/onex-toyblc/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type ServerOptions struct {
4141
Log *log.Options `json:"log" mapstructure:"log"`
4242
}
4343

44-
// Ensure ServerOptions implements the app.CliOptions interface.
45-
var _ app.CliOptions = (*ServerOptions)(nil)
44+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
45+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
4646

4747
// NewServerOptions creates a ServerOptions instance with default values.
4848
func NewServerOptions() *ServerOptions {

cmd/onex-usercenter/app/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ type ServerOptions struct {
5757
Log *log.Options `json:"log" mapstructure:"log"`
5858
}
5959

60-
// Ensure ServerOptions implements the app.CliOptions interface.
61-
var _ app.CliOptions = (*ServerOptions)(nil)
60+
// Ensure ServerOptions implements the app.NamedFlagSetOptions interface.
61+
var _ app.NamedFlagSetOptions = (*ServerOptions)(nil)
6262

6363
// NewServerOptions creates a ServerOptions instance with default values.
6464
func NewServerOptions() *ServerOptions {

configs/onex.sql

Lines changed: 341 additions & 167 deletions
Large diffs are not rendered by default.

configs/onex.sql.old

Lines changed: 403 additions & 0 deletions
Large diffs are not rendered by default.

internal/toyblc/handler/block.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
func (h *Handler) CreateBlock(c *gin.Context) {
1313
var rq v1.CreateBlockRequest
1414
if err := core.ShouldBindJSON(c, &rq); err != nil {
15-
core.WriteResponse(c, err, nil)
15+
core.WriteResponse(c, nil, err)
1616
return
1717
}
1818

@@ -22,5 +22,5 @@ func (h *Handler) CreateBlock(c *gin.Context) {
2222

2323
// ListBlock retrieves a list of blocks based on query parameters.
2424
func (h *Handler) ListBlock(c *gin.Context) {
25-
core.WriteResponse(c, nil, h.bs.List())
25+
core.WriteResponse(c, h.bs.List(), nil)
2626
}

internal/toyblc/handler/peer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ func (h *Handler) ListPeer(c *gin.Context) {
3535
}
3636
}
3737

38-
core.WriteResponse(c, nil, slice)
38+
core.WriteResponse(c, slice, nil)
3939
}

0 commit comments

Comments
 (0)