mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-14 20:38:10 -07:00
remove config package
This commit is contained in:
@@ -7,8 +7,9 @@ package http
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/chihaya/chihaya"
|
||||
)
|
||||
|
||||
type httpConfig struct {
|
||||
@@ -21,7 +22,7 @@ type httpConfig struct {
|
||||
RealIPHeader string `yaml:"real_ip_header"`
|
||||
}
|
||||
|
||||
func newHTTPConfig(srvcfg *config.ServerConfig) (*httpConfig, error) {
|
||||
func newHTTPConfig(srvcfg *chihaya.ServerConfig) (*httpConfig, error) {
|
||||
bytes, err := yaml.Marshal(srvcfg.Config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"github.com/tylerb/graceful"
|
||||
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"github.com/chihaya/chihaya"
|
||||
"github.com/chihaya/chihaya/server"
|
||||
"github.com/chihaya/chihaya/tracker"
|
||||
)
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
server.Register("http", constructor)
|
||||
}
|
||||
|
||||
func constructor(srvcfg *config.ServerConfig, tkr *tracker.Tracker) (server.Server, error) {
|
||||
func constructor(srvcfg *chihaya.ServerConfig, tkr *tracker.Tracker) (server.Server, error) {
|
||||
cfg, err := newHTTPConfig(srvcfg)
|
||||
if err != nil {
|
||||
return nil, errors.New("http: invalid config: " + err.Error())
|
||||
|
||||
Reference in New Issue
Block a user