-
Notifications
You must be signed in to change notification settings - Fork 3
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
Dev haokang #11
Dev haokang #11
Conversation
exporter/exporter.go
Outdated
@@ -95,8 +96,71 @@ func EcsClient() (client *ecs.Client) { | |||
return client | |||
} | |||
|
|||
func NewRedisClient() (client *r_kvstore.Client) { |
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.
Please use https://golang.org/doc/effective_go.html#embedding to do some refactoring on this part.
We can create a base struct
type Client struct {
Config alicloud.Config
}
type EcsClient struct {
*Client
}
type RedisClient struct {
*Client
}
exporter/exporter.go
Outdated
if os.Getenv("ALICLOUD_DEFAULT_REGION") == "" || | ||
os.Getenv("ALICLOUD_ACCESS_KEY") == "" || | ||
os.Getenv("ALICLOUD_SECRET_KEY") == "" { | ||
//get rolename |
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.
For the credential management, you can refer here https://github.com/aws/aws-sdk-go/tree/master/aws/credentials and learn from it.
exporter/redis.go
Outdated
} | ||
} | ||
|
||
func getEnv(input string) (output 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.
rename it to splitEnvFromName
No description provided.