Documentation
¶
Index ¶
- type Config
- type RestApi
- func (self *RestApi) Get(uin int64, uriMap *map[string]string) ([]byte, error)
- func (self *RestApi) Post(common_param, actions *map[string]interface{}) ([]byte, error)
- func (self *RestApi) SignGet(uin int64, uriMap *map[string]string) ([]byte, error)
- func (self *RestApi) SignPost(common_param, actions *map[string]interface{}) ([]byte, error)
- func (self *RestApi) SignPostV2(headMap, uriMap *map[string]string, actions *map[string]interface{}) ([]byte, error)
- type RestApiMgr
- type UrlConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ServiceName string `json:"service_name" yaml:"service_name"`
Urls []string `json:"urls" yaml:"urls"`
User string `json:"user" yaml:"user"`
Pass string `json:"pass" yaml:"pass"`
SignName string `json:"sign_name" yaml:"sign_name"`
}
ServiceAPI config struct
type RestApi ¶
type RestApi struct {
// contains filtered or unexported fields
}
*
- RestApi
- @Description:
*
func NewRestInstances ¶
* * @Description: new restapi impl * @param: conf * @return: *RestApi * @Author: Iori * @Date: 2022-07-06 15:14:20 *
func (*RestApi) Get ¶
* * @Description: get请求 * @param: uin * @param: uriMap * @return: map[string]interface{} * @return: error * @Author: Iori * @Date: 2022-07-06 17:11:14 *
func (*RestApi) Post ¶
* * @Description: post新规范请求 * @param: uin * @param: uriMap * @return: map[string]interface{} * @return: error * @Author: Iori * @Date: 2022-07-06 17:11:32 *
func (*RestApi) SignGet ¶
* * @Description: 带签名的get请求 * @param: uin * @param: uriMap * @return: map[string]interface{} * @return: error * @Author: Iori * @Date: 2022-07-06 17:11:14 *
func (*RestApi) SignPost ¶
* * @Description: 带签名的post,新规范请求 * @param: uin * @param: uriMap * @return: map[string]interface{} * @return: error * @Author: Iori * @Date: 2022-07-06 17:11:32 *
func (*RestApi) SignPostV2 ¶
func (self *RestApi) SignPostV2(headMap, uriMap *map[string]string, actions *map[string]interface{}) ([]byte, error)
* * @Description: 带签名的post,不带规范 * @param: uin * @param: uriMap * @return: map[string]interface{} * @return: error * @Author: Iori * @Date: 2025-03-15 17:11:32 *
type RestApiMgr ¶
*
- RestApiMgr
- @Description:
*
func NewRestApiMgr ¶
func NewRestApiMgr() *RestApiMgr
* * @Description: 创建restApi管理器 * @return: *RestApiMgr * @Author: Iori * @Date: 2022-02-14 11:28:59 *
func (*RestApiMgr) GetRestIns ¶
func (self *RestApiMgr) GetRestIns(keys ...string) *RestApi
* * @Description: 获取restApi实例 * @receiver: self * @param: key * @param: o * @Author: Iori * @Date: 2022-02-14 11:29:20 *
func (*RestApiMgr) Init ¶
func (self *RestApiMgr) Init(cfgs []Config, signs *http_sign.SignMgr)
* * @Description: 初始化RestApi管理器 * @receiver: self * @param: cfgs * @return: error * @Author: Iori * @Date: 2022-02-14 11:29:45 *
func (*RestApiMgr) SetRestIns ¶
func (self *RestApiMgr) SetRestIns(key string, impl *RestApi)
* * @Description: 设置restApi实例 * @param: key * @param: impl * @Author: Iori * @Date: 2022-02-14 16:13:53 *
func (*RestApiMgr) Tick ¶
func (self *RestApiMgr) Tick(nowMs int64)
* * @Description: tick * @receiver: self * @param: nowMs * @Author: Iori * @Date: 2022-02-14 11:39:54 *
type UrlConfig ¶
*
- UrlConfig
- @Description:
*
func NewUrlConf ¶
* * @Description: 创建url实例 * @param: urls * @return: config * @Author: Iori * @Date: 2022-07-06 15:12:21 *
func (*UrlConfig) GetHashUrl ¶
* * @Description: 根据uin hash获取 * @param: uin * @return: string * @Author: Iori * @Date: 2022-07-06 15:12:24 *