mirror of http://gitlab.batiao8.com/yic/film.git
30 lines
406 B
Go
30 lines
406 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"io/ioutil"
|
||
|
)
|
||
|
|
||
|
type Haha struct {
|
||
|
Token string `json:"token"`
|
||
|
}
|
||
|
|
||
|
var (
|
||
|
hahaConfig *Haha = nil
|
||
|
)
|
||
|
|
||
|
func LoadHahaConfig() {
|
||
|
body, err := ioutil.ReadFile("conf/haha.json")
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
dadiConfig = new(Dadi)
|
||
|
if err := json.Unmarshal([]byte(body), dadiConfig); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func GetHahaConfig() *Haha {
|
||
|
return hahaConfig
|
||
|
}
|