2023-04-15 23:29:27 +08:00
|
|
|
<?php
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
|
2023-04-15 23:31:16 +08:00
|
|
|
namespace Kiri\Router\Base;
|
2023-04-15 23:29:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Interface AuthorizationInterface
|
|
|
|
|
* @package Kiri\Http
|
|
|
|
|
*/
|
|
|
|
|
interface AuthorizationInterface
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string|int
|
|
|
|
|
* 获取唯一识别码
|
|
|
|
|
*/
|
|
|
|
|
public function getUniqueId(): string|int;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $key
|
|
|
|
|
* @param int $timeout
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function lock(string $key, int $timeout): bool;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $key
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function unlock(string $key): bool;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|