diff --git a/api/application.go b/api/application.go index 12f0b8e0..acbfec8c 100644 --- a/api/application.go +++ b/api/application.go @@ -44,7 +44,7 @@ func (api *API) GetApplication(c *common.Context) (interface{}, error) { // ListApplication list application func (api *API) ListApplication(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptionsAppendSystemLabel(c) + params, err := api.ParseListOptionsAppendSystemLabel(c) if err != nil { return nil, err } @@ -317,7 +317,7 @@ func (api *API) getBaseAppIfSet(c *common.Context) (*specV1.Application, error) return nil, nil } -func (api *API) parseListOptions(c *common.Context) (*models.ListOptions, error) { +func (api *API) ParseListOptions(c *common.Context) (*models.ListOptions, error) { params := &models.ListOptions{} if err := c.Bind(params); err != nil { return nil, err @@ -325,8 +325,8 @@ func (api *API) parseListOptions(c *common.Context) (*models.ListOptions, error) return params, nil } -func (api *API) parseListOptionsAppendSystemLabel(c *common.Context) (*models.ListOptions, error) { - opt, err := api.parseListOptions(c) +func (api *API) ParseListOptionsAppendSystemLabel(c *common.Context) (*models.ListOptions, error) { + opt, err := api.ParseListOptions(c) if err != nil { return nil, err } diff --git a/api/certificate.go b/api/certificate.go index fdd140f6..829fe0a5 100644 --- a/api/certificate.go +++ b/api/certificate.go @@ -25,7 +25,7 @@ func (api *API) GetCertificate(c *common.Context) (interface{}, error) { // ListCertificate list Certificate func (api *API) ListCertificate(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptionsAppendSystemLabel(c) + params, err := api.ParseListOptionsAppendSystemLabel(c) if err != nil { return nil, err } diff --git a/api/config.go b/api/config.go index 2a6c0598..0ef2705b 100644 --- a/api/config.go +++ b/api/config.go @@ -37,7 +37,7 @@ func (api *API) GetConfig(c *common.Context) (interface{}, error) { // ListConfig list config func (api *API) ListConfig(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptionsAppendSystemLabel(c) + params, err := api.ParseListOptionsAppendSystemLabel(c) if err != nil { return nil, err } diff --git a/api/node.go b/api/node.go index 14673d97..0b714c38 100644 --- a/api/node.go +++ b/api/node.go @@ -92,7 +92,7 @@ func (api *API) GetNodeStats(c *common.Context) (interface{}, error) { // ListNode list node func (api *API) ListNode(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptions(c) + params, err := api.ParseListOptions(c) if err != nil { return nil, err } diff --git a/api/registry.go b/api/registry.go index 56435177..3d34dc48 100644 --- a/api/registry.go +++ b/api/registry.go @@ -28,7 +28,7 @@ func (api *API) GetRegistry(c *common.Context) (interface{}, error) { // ListRegistry list Registry func (api *API) ListRegistry(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptionsAppendSystemLabel(c) + params, err := api.ParseListOptionsAppendSystemLabel(c) if err != nil { return nil, err } diff --git a/api/secret.go b/api/secret.go index fbe43834..55decfd7 100644 --- a/api/secret.go +++ b/api/secret.go @@ -28,7 +28,7 @@ func (api *API) GetSecret(c *common.Context) (interface{}, error) { // ListSecret list secret func (api *API) ListSecret(c *common.Context) (interface{}, error) { ns := c.GetNamespace() - params, err := api.parseListOptionsAppendSystemLabel(c) + params, err := api.ParseListOptionsAppendSystemLabel(c) if err != nil { return nil, err } diff --git a/plugin/database/index.go b/plugin/database/index.go index 6037d8b7..4f9e4b1f 100644 --- a/plugin/database/index.go +++ b/plugin/database/index.go @@ -54,13 +54,13 @@ func (d *DB) RefreshIndex(tx interface{}, namespace string, keyA, keyB common.Re } if len(res) > 0 { if _, err = d.DeleteIndexTx(transaction, namespace, keyB, keyA, valueA); err != nil { - return err - } + return err + } } for _, b := range valueBs { if _, err = d.CreateIndexTx(transaction, namespace, keyA, keyB, valueA, b); err != nil { - return err - } + return err + } } return nil } diff --git a/plugin/default/transaction/default_tx_factory.go b/plugin/default/transaction/default_tx_factory.go index 96ded664..f6fd7f30 100644 --- a/plugin/default/transaction/default_tx_factory.go +++ b/plugin/default/transaction/default_tx_factory.go @@ -8,7 +8,7 @@ func init() { plugin.RegisterFactory("defaulttx", New) } -type defaultTxFactory struct {} +type defaultTxFactory struct{} func New() (plugin.Plugin, error) { return &defaultTxFactory{}, nil diff --git a/service/wrapper.go b/service/wrapper.go index 5e89a8a7..a23d1193 100644 --- a/service/wrapper.go +++ b/service/wrapper.go @@ -8,7 +8,7 @@ import ( //go:generate mockgen -destination=../mock/service/wrapper.go -package=service github.com/baetyl/baetyl-cloud/v2/service WrapperService -type CreateNodeFunc func (tx interface{}, namespace string, node *specV1.Node) (*specV1.Node, error) +type CreateNodeFunc func(tx interface{}, namespace string, node *specV1.Node) (*specV1.Node, error) type WrapperService interface { CreateNodeTx(CreateNodeFunc) CreateNodeFunc