Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithBufferPolicy ¶
func ManagerType ¶
func ManagerType() interface{}
ManagerType returns the type of Manager interface. Can be used to implement common.HasType.
v2ray:api:stable
Types ¶
type Buffer ¶
type Buffer struct { // Size of buffer per connection, in bytes. -1 for unlimited buffer. PerConnection int32 }
Buffer contains settings for internal buffer.
func BufferPolicyFromContext ¶
type DefaultManager ¶
type DefaultManager struct{}
DefaultManager is the implementation of the Manager.
func (DefaultManager) ForLevel ¶
func (DefaultManager) ForLevel(level uint32) Session
ForLevel implements Manager.
func (DefaultManager) ForSystem ¶
func (DefaultManager) ForSystem() System
ForSystem implements Manager.
func (DefaultManager) Type ¶
func (DefaultManager) Type() interface{}
Type implements common.HasType.
type Manager ¶
type Manager interface { features.Feature // ForLevel returns the Session policy for the given user level. ForLevel(level uint32) Session // ForSystem returns the System policy for V2Ray system. ForSystem() System }
Manager is a feature that provides Policy for the given user by its id or level.
v2ray:api:stable
type Session ¶
Session is session based settings for controlling V2Ray requests. It contains various settings (or limits) that may differ for different users in the context.
func SessionDefault ¶
func SessionDefault() Session
SessionDefault returns the Policy when user is not specified.
type Stats ¶
type Stats struct { // Whether or not to enable stat counter for user uplink traffic. UserUplink bool // Whether or not to enable stat counter for user downlink traffic. UserDownlink bool }
Stats contains settings for stats counters.
type System ¶
type System struct { Stats SystemStats Buffer Buffer }
System contains policy settings at system level.
type SystemStats ¶
type SystemStats struct { // Whether or not to enable stat counter for uplink traffic in inbound handlers. InboundUplink bool // Whether or not to enable stat counter for downlink traffic in inbound handlers. InboundDownlink bool // Whether or not to enable stat counter for uplink traffic in outbound handlers. OutboundUplink bool // Whether or not to enable stat counter for downlink traffic in outbound handlers. OutboundDownlink bool }
SystemStats contains stat policy settings on system level.
type Timeout ¶
type Timeout struct { // Timeout for handshake phase in a connection. Handshake time.Duration // Timeout for connection being idle, i.e., there is no egress or ingress traffic in this connection. ConnectionIdle time.Duration // Timeout for an uplink only connection, i.e., the downlink of the connection has been closed. UplinkOnly time.Duration // Timeout for an downlink only connection, i.e., the uplink of the connection has been closed. DownlinkOnly time.Duration }
Timeout contains limits for connection timeout.