modify plugin name

This commit is contained in:
2022-06-16 17:38:23 +08:00
parent 10de6b5246
commit 4daad7d111
22 changed files with 1206 additions and 70 deletions
@@ -0,0 +1,22 @@
<?php
namespace Kiri\Websocket\Contract;
use Swoole\WebSocket\Frame;
use Swoole\WebSocket\Server;
use Swoole\Coroutine\Http\Server as CoroutineServer;
interface OnCloseInterface
{
/**
* @param Server|CoroutineServer $server
* @param int $fd
* @return void
*/
public function onClose(Server|CoroutineServer $server, int $fd): void;
}
@@ -0,0 +1,21 @@
<?php
namespace Kiri\Websocket\Contract;
use Swoole\Http\Request;
use Swoole\Http\Response;
interface OnHandshakeInterface
{
/**
* @param Request $request
* @param Response $response
* @return int
*/
public function onHandshake(Request $request, Response $response): int;
}
@@ -0,0 +1,22 @@
<?php
namespace Kiri\Websocket\Contract;
use Swoole\WebSocket\Frame;
use Swoole\WebSocket\Server;
use Swoole\Coroutine\Http\Server as CoroutineServer;
interface OnMessageInterface
{
/**
* @param Server|CoroutineServer $server
* @param Frame $frame
* @return void
*/
public function onMessage(Server|CoroutineServer $server, Frame $frame): void;
}
@@ -0,0 +1,23 @@
<?php
namespace Kiri\Websocket\Contract;
use Swoole\Http\Request;
use Swoole\WebSocket\Frame;
use Swoole\WebSocket\Server;
use Swoole\Coroutine\Http\Server as CoroutineServer;
interface OnOpenInterface
{
/**
* @param Server|CoroutineServer $server
* @param Request $request
* @return void
*/
public function onOpen(Server|CoroutineServer $server, Request $request): void;
}