Module common

Source
Expand description

Some common initialization helper methods 一些公共的初始化辅助方法

§Mainly includes the following functions:

  1. Isolation flag processing. The isolation identifier is the data used to distinguish the subject of the request (tenant or application). For example, application a and application b use the same cache service instance and both use the same cache key. To avoid data confusion, you can use the isolation flag as part of the cache key to distinguish different application data. For the private [crate::spi::domain::spi_bs::Model::private] backend implementation instance, the isolation flag is not required, because the private instance will only be used by one subject of the request.

§主要包含如下功能:

  1. 隔离标识处理。隔离标识是用于区分请求主体(租户或应用)的数据。 比如应用a与应用b使用相同的缓存服务实例且都使用了相同的缓存key,为了避免数据混乱,可以通过隔离标识作为缓存key的一部分来区分不同的应用数据。 对于私有 [crate::spi::domain::spi_bs::Model::private] 的后端实现实例不需要隔离标识,因为私有实例只会被一个请求主体使用。

Functions§

get_isolation_flag_from_context
Get the context’s owner as the isolation flag 获取上下文的owner作为隔离标识
get_isolation_flag_from_ext
Get the isolation flag from the extension 从扩展中获取隔离标识
set_isolation_flag_to_ext
Set the isolation flag to the extension 将隔离标识设置到扩展中