center-config/client/init.go

33 lines
573 B
Go
Raw Permalink Normal View History

2021-11-30 17:50:21 +08:00
// Package client ...
//
// Description : client ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2021-11-30 10:51 上午
package client
import (
"errors"
)
var (
// CenterConfig ...
CenterConfig *CenterClient
)
// NewClient ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 10:56 上午 2021/11/30
func NewClient(cfg *Config) error {
if nil == cfg || len(cfg.Namespace) == 0 || len(cfg.AppID) == 0 || len(cfg.Domain) == 0 {
return errors.New("client cfg is error")
}
CenterConfig = &CenterClient{
cfg: cfg,
}
return nil
}