Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support create/delete project and fix other minor issues. #11

Merged
merged 5 commits into from
Apr 11, 2017

Conversation

hryang
Copy link

@hryang hryang commented Mar 31, 2017

  1. Implement the Create/DeleteProject.
  2. Use v0.6.0 API.
  3. Add the request id in Error struct

client.go Outdated
Endpoint string // IP or hostname of SLS endpoint
AccessKeyID string
AccessKeySecret string
SessionToken string
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是参照LogProject里的SessionToken,那我一并改掉吧

log_store.go Outdated
}

uri := fmt.Sprintf("/logstores/%s/index", s.Name)
println(string(body))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this debug info

log_store.go Outdated
return err
}

func (s *LogStore) GetIndex() error {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetIndex 为什么没有返回 Index

Token []string `json:"token"`
CaseSensitive bool `json:"caseSensitive"`
IncludeKeys []string `json:"include_keys,omitempty"`
ExcludeKeys []string `json:"exclude_keys,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考 : ma6174/blog#18
http://gitlab.alibaba-inc.com/serverless/lambda-go-sdk/blob/master/function.go

不确定一定会有问题, 但上述方式更清楚

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是说都用指针?数组的初值都是nil,因此不需要用指针

project_test.go Outdated
for i := 0; i < 1; i++ {
var err error
name := fmt.Sprintf("faint%d", i)
//proj, err := c.CreateProject(name, "this is faint")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里被注释了,没有 create 出来

project_test.go Outdated
if err != nil {
fmt.Printf("Delete project error: %v\n", err)
return
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 test 是不打算跑吗? 一个 assert 都没有, xxx_test.go 会被放到 triavis CI 中跑的

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

手测的,loghub的project操作有些是异步的,写出reliable的test稍微有点麻烦。我先把测试删了,我现在没有时间加测试

@galaxydi galaxydi merged commit b49fc98 into galaxydi:master Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants