// Policy is session based settings for controlling V2Ray requests. It contains various settings (or limits) that may differ for different users in the context.
typePolicystruct{
TimeoutsTimeoutPolicy// Timeout settings
}
// OverrideWith overrides the current Policy with another one. All values with default value will be overridden.
func(pPolicy)OverrideWith(anotherPolicy)Policy{
p.Timeouts.OverrideWith(another.Timeouts)
returnp
}
// PolicyManager is a feature that provides Policy for the given user by its id or level.
typePolicyManagerinterface{
Feature
// ForLevel returns the Policy for the given user level.
ForLevel(leveluint32)Policy
}
// DefaultPolicy returns the Policy when user is not specified.