Skip to content

Commit

Permalink
Merge pull request #71 from qiniu/develop
Browse files Browse the repository at this point in the history
QCOS-0 Release 2.3.0
  • Loading branch information
nowenL committed Jan 18, 2017
2 parents 7bb9a50 + 3a37f14 commit 67e1e9d
Show file tree
Hide file tree
Showing 960 changed files with 286,020 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ _testmain.go
*.out

# external packages folder
vendor/
# vendor/

# ds_store files
.DS_Store
.DS_Store
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout 84607742b10f492430762d038e954236bbaf23f7 && go install
- cd $PROJECT_ROOT/kirk
- echo $GOPATH
- glide --debug install

script:
- make style
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# vNext

# Release 2.3.0
- SpecInfo 添加 Regions 字段
- 增加 list grants 接口

# Release 2.2.0
- vendorManaged 应用状态的response 改details为message
- ListRepoTags和GetImageConfig 支持获取imagesize
Expand Down
11 changes: 11 additions & 0 deletions kirksdk/account_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ type AccountClient interface {
// GetGrantedAppKey 获取被授权应用的key
GetGrantedAppKey(ctx context.Context, appURI string) (ret GrantedAppKey, err error)

// ListGrants 获取自己授权给别人的应用列表
ListGrants(ctx context.Context) (ret []GrantInfo, err error)

// GetAppspecs 获得应用模板信息
GetAppspecs(ctx context.Context, specURI string) (ret SpecInfo, err error)

Expand Down Expand Up @@ -228,6 +231,13 @@ type GrantedAppKey struct {
Sk string `json:"sk"`
}

// GrantInfo 应用授权信息
type GrantInfo struct {
Account string `json:"account"`
AppURI string `json:"appuri"`
CreatedAt time.Time `json:"ctime"`
}

// SpecInfo 包含 Spec 的相关信息
type SpecInfo struct {
URI string `json:"uri"`
Expand All @@ -241,6 +251,7 @@ type SpecInfo struct {
Seedimg string `json:"seedimg"`
Entryport uint16 `json:"entryport"`
Privileges []string `json:"privileges"`
Regions []string `json:"regions"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
Expand Down
6 changes: 6 additions & 0 deletions kirksdk/account_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ func (p *accountClientImp) CreateAppGrant(ctx context.Context, appURI, username
return
}

func (p *accountClientImp) ListGrants(ctx context.Context) (ret []GrantInfo, err error) {
url := fmt.Sprintf("%s%s/grants", p.host, appVersionPrefix)
err = p.client.Call(ctx, &ret, "GET", url)
return
}

func (p *accountClientImp) DeleteAppGrant(ctx context.Context, appURI, username string) (err error) {
url := fmt.Sprintf("%s%s/apps/%s/grants/%s", p.host, appVersionPrefix, appURI, username)
err = p.client.Call(ctx, nil, "DELETE", url)
Expand Down
2 changes: 1 addition & 1 deletion kirksdk/kirksdk.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package kirksdk

const Version = "2.2.0"
const Version = "2.3.0"
1 change: 1 addition & 0 deletions vendor/github.com/Sirupsen/logrus/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/github.com/Sirupsen/logrus/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions vendor/github.com/Sirupsen/logrus/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/Sirupsen/logrus/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 67e1e9d

Please sign in to comment.