// Timeout contains limits for connection timeout.
typeTimeoutstruct{
// Timeout for handshake phase in a connection.
Handshaketime.Duration
// Timeout for connection being idle, i.e., there is no egress or ingress traffic in this connection.
ConnectionIdletime.Duration
// Timeout for an uplink only connection, i.e., the downlink of the connection has been closed.
UplinkOnlytime.Duration
// Timeout for an downlink only connection, i.e., the uplink of the connection has been closed.
DownlinkOnlytime.Duration
}
// Stats contains settings for stats counters.
typeStatsstruct{
// Whether or not to enable stat counter for user uplink traffic.
UserUplinkbool
// Whether or not to enable stat counter for user downlink traffic.
UserDownlinkbool
}
// Buffer contains settings for internal buffer.
typeBufferstruct{
// Size of buffer per connection, in bytes. -1 for unlimited buffer.
PerConnectionint32
}
// SystemStats contains stat policy settings on system level.
typeSystemStatsstruct{
// Whether or not to enable stat counter for uplink traffic in inbound handlers.
InboundUplinkbool
// Whether or not to enable stat counter for downlink traffic in inbound handlers.
InboundDownlinkbool
}
// System contains policy settings at system level.
typeSystemstruct{
StatsSystemStats
BufferBuffer
}
// Session is session based settings for controlling V2Ray requests. It contains various settings (or limits) that may differ for different users in the context.
typeSessionstruct{
TimeoutsTimeout// Timeout settings
StatsStats
BufferBuffer
}
// Manager is a feature that provides Policy for the given user by its id or level.
typeManagerinterface{
features.Feature
// ForLevel returns the Session policy for the given user level.
ForLevel(leveluint32)Session
// ForSystem returns the System policy for V2Ray system.