34 lines
548 B
Go
34 lines
548 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/BurntSushi/toml"
|
|
)
|
|
|
|
type Config struct {
|
|
Server struct {
|
|
APIURL string
|
|
Port string
|
|
}
|
|
Group struct {
|
|
AllowGroup []string
|
|
AllowUser []string
|
|
AllowRole []string
|
|
BlockGroup []string
|
|
BlockUser []string
|
|
GroupNotAllow []string
|
|
UserNotAllow []string
|
|
RoleNotAllow []string
|
|
}
|
|
}
|
|
|
|
var GlobalConfig Config
|
|
|
|
func init() {
|
|
// var config Config
|
|
if _, err := toml.DecodeFile("config.toml", &GlobalConfig); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
// fmt.Println(config.Group)
|
|
}
|