mirror of https://github.com/q191201771/lal.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
415 B
Go
24 lines
415 B
Go
6 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"github.com/q191201771/lal/httpflv"
|
||
|
"io/ioutil"
|
||
|
)
|
||
|
|
||
|
type Config struct {
|
||
|
HttpFlv httpflv.Config `json:"httpflv"`
|
||
|
}
|
||
|
|
||
|
func LoadConf(confFile string) (*Config, error) {
|
||
|
var config Config
|
||
|
rawContent, err := ioutil.ReadFile(confFile)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if err = json.Unmarshal(rawContent, &config); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &config, nil
|
||
|
}
|