Reply back AccessKey, Secretkey through json

This commit is contained in:
Harshavardhana
2015-02-05 15:59:44 -08:00
parent 95f214c99b
commit 72d0999dcb
2 changed files with 51 additions and 8 deletions

View File

@@ -45,6 +45,24 @@ func (c *Config) GetConfigPath() string {
return c.configPath
}
func (c *Config) IsUserExists(username string) bool {
for _, user := range c.Users {
if user.Name == username {
return true
}
}
return false
}
func (c *Config) GetUser(username string) User {
for _, user := range c.Users {
if user.Name == username {
return user
}
}
return User{}
}
func (c *Config) AddUser(user User) {
var currentUsers map[string]User
if len(c.Users) == 0 {