/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
frame/gins/gins_httpclient.go
22 строки
691 B
John Guo
add LevelPrint configuration for glog.Logger; add package internal/instance for grouped instance management feature; add default logger for panic message printing if no logger set in gcron.Cron (#2388)
06 янв 2023, 09:15
Не верифицирован
06 янв 2023, 09:15
ae4f14c
Код
Авторство
О чём код?
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gins import ( "fmt" "github.com/gogf/gf/v2/internal/instance" "github.com/gogf/gf/v2/net/gclient" ) // HttpClient returns an instance of http client with specified name. func HttpClient(name ...interface{}) *gclient.Client { var instanceKey = fmt.Sprintf("%s.%v", frameCoreComponentNameHttpClient, name) return instance.GetOrSetFuncLock(instanceKey, func() interface{} { return gclient.New() }).(*gclient.Client) }