fixed user attributes for /users
This commit is contained in:
parent
d4218382f7
commit
e934aa5a92
38
main.go
38
main.go
@ -18,14 +18,14 @@ type Userstruct struct {
|
|||||||
Users []Userinfo
|
Users []Userinfo
|
||||||
}
|
}
|
||||||
type Userinfo struct {
|
type Userinfo struct {
|
||||||
name string
|
Name string
|
||||||
fullname string
|
FullName string
|
||||||
loc string
|
Loc string
|
||||||
email string
|
Email string
|
||||||
desc string
|
Desc string
|
||||||
website string
|
Website string
|
||||||
capsule string
|
Capsule string
|
||||||
online bool
|
Online bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func Dedup(input string) string {
|
func Dedup(input string) string {
|
||||||
@ -61,9 +61,9 @@ func userdata(username, usersonline string) Userinfo {
|
|||||||
log.Error(username + " does not have a meta-info.env")
|
log.Error(username + " does not have a meta-info.env")
|
||||||
var user Userinfo
|
var user Userinfo
|
||||||
if strings.Contains(usersonline, " "+username) == true {
|
if strings.Contains(usersonline, " "+username) == true {
|
||||||
user.online = true
|
user.Online = true
|
||||||
} else {
|
} else {
|
||||||
user.online = false
|
user.Online = false
|
||||||
}
|
}
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
@ -71,17 +71,17 @@ func userdata(username, usersonline string) Userinfo {
|
|||||||
viper.SetConfigFile(filename)
|
viper.SetConfigFile(filename)
|
||||||
viper.ReadInConfig()
|
viper.ReadInConfig()
|
||||||
var user Userinfo
|
var user Userinfo
|
||||||
user.name = viper.GetString("USERNAME")
|
user.Name = viper.GetString("USERNAME")
|
||||||
user.fullname = viper.GetString("FULL_NAME")
|
user.FullName = viper.GetString("FULL_NAME")
|
||||||
user.capsule = viper.GetString("GEMINI_CAPSULE")
|
user.Capsule = viper.GetString("GEMINI_CAPSULE")
|
||||||
user.website = viper.GetString("WEBSITE")
|
user.Website = viper.GetString("WEBSITE")
|
||||||
user.desc = viper.GetString("DESCRIPTION")
|
user.Desc = viper.GetString("DESCRIPTION")
|
||||||
user.email = viper.GetString("EMAIL")
|
user.Email = viper.GetString("EMAIL")
|
||||||
user.loc = viper.GetString("LOCATION")
|
user.Loc = viper.GetString("LOCATION")
|
||||||
if strings.Contains(usersonline, " "+username) == true {
|
if strings.Contains(usersonline, " "+username) == true {
|
||||||
user.online = true
|
user.Online = true
|
||||||
} else {
|
} else {
|
||||||
user.online = false
|
user.Online = false
|
||||||
}
|
}
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user