Skip to content

Commit 5cb6136

Browse files
authored
baetyl-979 public ParseListOptions and ParseListOptionsAppendSystemLabel (#308)
1 parent 15bdde6 commit 5cb6136

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

api/application.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (api *API) GetApplication(c *common.Context) (interface{}, error) {
4444
// ListApplication list application
4545
func (api *API) ListApplication(c *common.Context) (interface{}, error) {
4646
ns := c.GetNamespace()
47-
params, err := api.parseListOptionsAppendSystemLabel(c)
47+
params, err := api.ParseListOptionsAppendSystemLabel(c)
4848
if err != nil {
4949
return nil, err
5050
}
@@ -317,16 +317,16 @@ func (api *API) getBaseAppIfSet(c *common.Context) (*specV1.Application, error)
317317
return nil, nil
318318
}
319319

320-
func (api *API) parseListOptions(c *common.Context) (*models.ListOptions, error) {
320+
func (api *API) ParseListOptions(c *common.Context) (*models.ListOptions, error) {
321321
params := &models.ListOptions{}
322322
if err := c.Bind(params); err != nil {
323323
return nil, err
324324
}
325325
return params, nil
326326
}
327327

328-
func (api *API) parseListOptionsAppendSystemLabel(c *common.Context) (*models.ListOptions, error) {
329-
opt, err := api.parseListOptions(c)
328+
func (api *API) ParseListOptionsAppendSystemLabel(c *common.Context) (*models.ListOptions, error) {
329+
opt, err := api.ParseListOptions(c)
330330
if err != nil {
331331
return nil, err
332332
}

api/certificate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (api *API) GetCertificate(c *common.Context) (interface{}, error) {
2525
// ListCertificate list Certificate
2626
func (api *API) ListCertificate(c *common.Context) (interface{}, error) {
2727
ns := c.GetNamespace()
28-
params, err := api.parseListOptionsAppendSystemLabel(c)
28+
params, err := api.ParseListOptionsAppendSystemLabel(c)
2929
if err != nil {
3030
return nil, err
3131
}

api/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (api *API) GetConfig(c *common.Context) (interface{}, error) {
3737
// ListConfig list config
3838
func (api *API) ListConfig(c *common.Context) (interface{}, error) {
3939
ns := c.GetNamespace()
40-
params, err := api.parseListOptionsAppendSystemLabel(c)
40+
params, err := api.ParseListOptionsAppendSystemLabel(c)
4141
if err != nil {
4242
return nil, err
4343
}

api/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (api *API) GetNodeStats(c *common.Context) (interface{}, error) {
9292
// ListNode list node
9393
func (api *API) ListNode(c *common.Context) (interface{}, error) {
9494
ns := c.GetNamespace()
95-
params, err := api.parseListOptions(c)
95+
params, err := api.ParseListOptions(c)
9696
if err != nil {
9797
return nil, err
9898
}

api/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (api *API) GetRegistry(c *common.Context) (interface{}, error) {
2828
// ListRegistry list Registry
2929
func (api *API) ListRegistry(c *common.Context) (interface{}, error) {
3030
ns := c.GetNamespace()
31-
params, err := api.parseListOptionsAppendSystemLabel(c)
31+
params, err := api.ParseListOptionsAppendSystemLabel(c)
3232
if err != nil {
3333
return nil, err
3434
}

api/secret.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (api *API) GetSecret(c *common.Context) (interface{}, error) {
2828
// ListSecret list secret
2929
func (api *API) ListSecret(c *common.Context) (interface{}, error) {
3030
ns := c.GetNamespace()
31-
params, err := api.parseListOptionsAppendSystemLabel(c)
31+
params, err := api.ParseListOptionsAppendSystemLabel(c)
3232
if err != nil {
3333
return nil, err
3434
}

plugin/database/index.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ func (d *DB) RefreshIndex(tx interface{}, namespace string, keyA, keyB common.Re
5454
}
5555
if len(res) > 0 {
5656
if _, err = d.DeleteIndexTx(transaction, namespace, keyB, keyA, valueA); err != nil {
57-
return err
58-
}
57+
return err
58+
}
5959
}
6060
for _, b := range valueBs {
6161
if _, err = d.CreateIndexTx(transaction, namespace, keyA, keyB, valueA, b); err != nil {
62-
return err
63-
}
62+
return err
63+
}
6464
}
6565
return nil
6666
}

plugin/default/transaction/default_tx_factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ func init() {
88
plugin.RegisterFactory("defaulttx", New)
99
}
1010

11-
type defaultTxFactory struct {}
11+
type defaultTxFactory struct{}
1212

1313
func New() (plugin.Plugin, error) {
1414
return &defaultTxFactory{}, nil

service/wrapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
//go:generate mockgen -destination=../mock/service/wrapper.go -package=service github.com/baetyl/baetyl-cloud/v2/service WrapperService
1010

11-
type CreateNodeFunc func (tx interface{}, namespace string, node *specV1.Node) (*specV1.Node, error)
11+
type CreateNodeFunc func(tx interface{}, namespace string, node *specV1.Node) (*specV1.Node, error)
1212

1313
type WrapperService interface {
1414
CreateNodeTx(CreateNodeFunc) CreateNodeFunc

0 commit comments

Comments
 (0)