Skip to content

Commit

Permalink
apache#87 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoliang committed Feb 6, 2020
1 parent 94360b5 commit 7f15f52
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions server/resource/v1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const (
MaxWait = 5 * time.Minute
)

//err
var (
ErrInvalidRev = errors.New(MsgInvalidRev)
)
Expand Down
1 change: 1 addition & 0 deletions server/resource/v1/kv_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (r *KVResource) GetByKey(rctx *restful.Context) {
returnData(rctx, domain, project, labels, limit, offset)
}

//List response kv list
func (r *KVResource) List(rctx *restful.Context) {
var err error
project := rctx.ReadPathParameter("project")
Expand Down
5 changes: 2 additions & 3 deletions server/resource/v1/label_resouce.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import (
"net/http"
)

//LabelResource
//LabelResource is label API
type LabelResource struct {
}

//PutLabel
// update by label_id , only can modify alias
//PutLabel update by label_id , only can modify alias
// create return 201 / update return 200
func (r *LabelResource) PutLabel(context *restful.Context) {
var err error
Expand Down
2 changes: 1 addition & 1 deletion server/service/mongo/label/label_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func CreateLabel(ctx context.Context, label *model.LabelDoc) (*model.LabelDoc, e
return label, nil
}

//UpdateLabel
//UpdateLabel update alias
func UpdateLabel(ctx context.Context, label *model.LabelDoc) (*model.LabelDoc, error) {
collection := session.GetDB().Collection(session.CollectionLabel)
queryFilter := bson.M{"id": label.ID}
Expand Down
2 changes: 2 additions & 0 deletions server/service/mongo/label/label_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import (
"github.com/apache/servicecomb-kie/pkg/model"
)

//Service is db service
type Service struct {
}

//CreateOrUpdate create or update labels
func (s *Service) CreateOrUpdate(ctx context.Context, label *model.LabelDoc) (*model.LabelDoc, error) {
if label.ID != "" {
return UpdateLabel(ctx, label)
Expand Down
3 changes: 3 additions & 0 deletions server/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ type KV interface {
type History interface {
GetHistory(ctx context.Context, keyID string, options ...FindOption) ([]*model.KVDoc, error)
}

//Revision is global revision number management
type Revision interface {
GetRevision(ctx context.Context, domain string) (int64, error)
}

//Label manages labels data
type Label interface {
CreateOrUpdate(ctx context.Context, label *model.LabelDoc) (*model.LabelDoc, error)
}
Expand Down

0 comments on commit 7f15f52

Please sign in to comment.