4 Star 0 Fork 0

wanttobeamaster / elasticell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cfg.go 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
wanttobeamaster 提交于 2021-04-20 00:42 . xiaoxiao
// Copyright 2016 DeepFabric, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package server
import (
"encoding/json"
"gitee.com/wanttobeamaster/elasticell/pkg/node"
"gitee.com/wanttobeamaster/elasticell/pkg/util"
"github.com/pkg/errors"
)
// Cfg server configuration
type Cfg struct {
AddrCli string
//AdvertiseAddrCli string
BufferCliRead int
BufferCliWrite int
BatchCliResps int64
Node *node.Cfg
Metric *util.MetricCfg
}
// NewCfg returns default cfg
func NewCfg() *Cfg {
return &Cfg{
Node: node.NewCfg(),
}
}
func unmarshal(data []byte) (*Cfg, error) {
v := &Cfg{}
err := json.Unmarshal(data, v)
if nil != err {
return nil, errors.Wrap(err, "")
}
return v, nil
}
Go
1
https://gitee.com/wanttobeamaster/elasticell.git
git@gitee.com:wanttobeamaster/elasticell.git
wanttobeamaster
elasticell
elasticell
8b1bff0b0046

搜索帮助