2017-07-07 16:57:39 +08:00
|
|
|
/**
|
|
|
|
* Copyright (C) 2015-2018
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* AUTHOR(S)
|
|
|
|
* Zheng Shuxin
|
|
|
|
* E-mail: zhengshuxin@qiyi.com
|
|
|
|
*
|
|
|
|
* VERSION
|
|
|
|
* Thu 08 Sep 2016 04:24:52 PM CST
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct kill_req_t;
|
|
|
|
struct kill_res_t;
|
|
|
|
struct kill_res_data_t;
|
2017-09-22 18:05:34 +08:00
|
|
|
class http_client;
|
2017-07-07 16:57:39 +08:00
|
|
|
|
|
|
|
class service_kill
|
|
|
|
{
|
|
|
|
public:
|
2017-09-22 18:05:34 +08:00
|
|
|
service_kill(http_client& client) : client_(client) {}
|
2017-07-07 16:57:39 +08:00
|
|
|
~service_kill(void) {}
|
|
|
|
|
2017-09-22 18:05:34 +08:00
|
|
|
bool run(acl::json& json);
|
2017-07-07 16:57:39 +08:00
|
|
|
|
|
|
|
private:
|
2017-09-22 18:05:34 +08:00
|
|
|
bool handle(const kill_req_t& req, kill_res_t& res);
|
2017-07-07 16:57:39 +08:00
|
|
|
bool kill_one(const char* path, kill_res_data_t& data);
|
2017-09-22 18:05:34 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
http_client& client_;
|
2017-07-07 16:57:39 +08:00
|
|
|
};
|