async www read write
This commit is contained in:
+21
-19
@@ -4,7 +4,7 @@ import (
|
||||
"github.com/go-ini/ini"
|
||||
)
|
||||
|
||||
type server_t struct {
|
||||
type ice_server_t struct {
|
||||
NAME string
|
||||
ADDR string
|
||||
PORT int
|
||||
@@ -14,7 +14,7 @@ type server_t struct {
|
||||
STYPE int
|
||||
}
|
||||
|
||||
type ice_t struct {
|
||||
type ice_stream_t struct {
|
||||
NAME string
|
||||
DESC string
|
||||
GENRE string
|
||||
@@ -48,10 +48,11 @@ type archive_t struct {
|
||||
}
|
||||
|
||||
type config_t struct {
|
||||
Track Track_t
|
||||
Server server_t
|
||||
Ice ice_t
|
||||
Archive archive_t
|
||||
Track Track_t
|
||||
IceServer ice_server_t
|
||||
IceStream ice_stream_t
|
||||
Archive archive_t
|
||||
WWWport string
|
||||
}
|
||||
|
||||
var Xcfg config_t
|
||||
@@ -63,23 +64,24 @@ func Loadconfig(filename string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
Xcfg.Server.NAME = ini.Section("server").Key("name").Value()
|
||||
Xcfg.Server.ADDR = ini.Section("server").Key("addr").Value()
|
||||
Xcfg.Server.PORT, _ = ini.Section("server").Key("port").Int()
|
||||
Xcfg.Server.MOUNT = ini.Section("server").Key("mount").Value()
|
||||
Xcfg.Server.USR = ini.Section("server").Key("usr").Value()
|
||||
Xcfg.Server.PWD = ini.Section("server").Key("pwd").Value()
|
||||
Xcfg.IceServer.NAME = ini.Section("ice-server").Key("name").Value()
|
||||
Xcfg.IceServer.ADDR = ini.Section("ice-server").Key("addr").Value()
|
||||
Xcfg.IceServer.PORT, _ = ini.Section("ice-server").Key("port").Int()
|
||||
Xcfg.IceServer.MOUNT = ini.Section("ice-server").Key("mount").Value()
|
||||
Xcfg.IceServer.USR = ini.Section("ice-server").Key("usr").Value()
|
||||
Xcfg.IceServer.PWD = ini.Section("ice-server").Key("pwd").Value()
|
||||
|
||||
Xcfg.Ice.NAME = ini.Section("ice").Key("name").Value()
|
||||
Xcfg.Ice.DESC = ini.Section("ice").Key("desc").Value()
|
||||
Xcfg.Ice.GENRE = ini.Section("ice").Key("genre").Value()
|
||||
Xcfg.Ice.URL = ini.Section("ice").Key("url").Value()
|
||||
Xcfg.Ice.IRC = ini.Section("ice").Key("irc").Value()
|
||||
Xcfg.Ice.AIM = ini.Section("ice").Key("aim").Value()
|
||||
Xcfg.Ice.PUB = ini.Section("ice").Key("pub").Value()
|
||||
Xcfg.IceStream.NAME = ini.Section("ice-stream").Key("name").Value()
|
||||
Xcfg.IceStream.DESC = ini.Section("ice-stream").Key("desc").Value()
|
||||
Xcfg.IceStream.GENRE = ini.Section("ice-stream").Key("genre").Value()
|
||||
Xcfg.IceStream.URL = ini.Section("ice-stream").Key("url").Value()
|
||||
Xcfg.IceStream.IRC = ini.Section("ice-stream").Key("irc").Value()
|
||||
Xcfg.IceStream.AIM = ini.Section("ice-stream").Key("aim").Value()
|
||||
Xcfg.IceStream.PUB = ini.Section("ice-stream").Key("pub").Value()
|
||||
|
||||
Xcfg.Archive.PATH = ini.Section("archive").Key("path").Value()
|
||||
|
||||
Xcfg.WWWport = ini.Section("www-server").Key("port").Value()
|
||||
|
||||
Xcfg.Archive.ALBUMS = make(map[uint32]Album_t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user