-
Notifications
You must be signed in to change notification settings - Fork 129
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
Conversation
hryang
commented
Mar 31, 2017
- Implement the Create/DeleteProject.
- Use v0.6.0 API.
- Add the request id in Error struct
client.go
Outdated
Endpoint string // IP or hostname of SLS endpoint | ||
AccessKeyID string | ||
AccessKeySecret string | ||
SessionToken string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在 ram 中通常叫做SecurityToken, 参考 https://help.aliyun.com/document_detail/28765.html?spm=5176.doc28756.6.681.wVeuvq
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
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
不确定一定会有问题, 但上述方式更清楚
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 | ||
} |
There was a problem hiding this comment.
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 中跑的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
手测的,loghub的project操作有些是异步的,写出reliable的test稍微有点麻烦。我先把测试删了,我现在没有时间加测试