You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/service/cloudflare/client.go

32 lines
628 B

package cloudflare
import (
"github.com/dtapps/go-library/utils/dorm"
"github.com/dtapps/go-library/utils/gorequest"
"gorm.io/gorm"
)
type ConfigClient struct {
AccountID string
ZoneID string
GlobalAPIKey string
MongoDb *dorm.MongoClient // 日志数据库
PgsqlDb *gorm.DB // 日志数据库
DatabaseName string // 库名
}
type Client struct {
client *gorequest.App // 请求客户端
config *ConfigClient // 配置
}
func NewClient(config *ConfigClient) (*Client, error) {
var err error
c := &Client{config: config}
c.client = gorequest.NewHttp()
return c, nil
}