import "github.com/v2ray/v2ray-core/app/policy"
Package policy is an implementation of policy.Manager feature.
config.go config.pb.go errors.generated.go manager.go policy.go
var File_app_policy_config_proto protoreflect.FileDescriptor
type Config struct { Level map[uint32]*Policy `protobuf:"bytes,1,rep,name=level,proto3" json:"level,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` System *SystemPolicy `protobuf:"bytes,2,opt,name=system,proto3" json:"system,omitempty"` // contains filtered or unexported fields }
Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (x *Config) GetSystem() *SystemPolicy
func (x *Config) ProtoReflect() protoreflect.Message
type Instance struct {
// contains filtered or unexported fields
}
Instance is an instance of Policy manager.
New creates new Policy manager instance.
Close implements common.Closable.Close().
ForLevel implements policy.Manager.
ForSystem implements policy.Manager.
Start implements common.Runnable.Start().
Type implements common.HasType.
type Policy struct { Timeout *Policy_Timeout `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` Stats *Policy_Stats `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"` Buffer *Policy_Buffer `protobuf:"bytes,3,opt,name=buffer,proto3" json:"buffer,omitempty"` // contains filtered or unexported fields }
Deprecated: Use Policy.ProtoReflect.Descriptor instead.
func (x *Policy) GetBuffer() *Policy_Buffer
func (x *Policy) GetStats() *Policy_Stats
func (x *Policy) GetTimeout() *Policy_Timeout
func (x *Policy) ProtoReflect() protoreflect.Message
ToCorePolicy converts this Policy to policy.Session.
type Policy_Buffer struct { // Buffer size per connection, in bytes. -1 for unlimited buffer. Connection int32 `protobuf:"varint,1,opt,name=connection,proto3" json:"connection,omitempty"` // contains filtered or unexported fields }
func (*Policy_Buffer) Descriptor() ([]byte, []int)
Deprecated: Use Policy_Buffer.ProtoReflect.Descriptor instead.
func (x *Policy_Buffer) GetConnection() int32
func (*Policy_Buffer) ProtoMessage()
func (x *Policy_Buffer) ProtoReflect() protoreflect.Message
func (x *Policy_Buffer) Reset()
func (x *Policy_Buffer) String() string
type Policy_Stats struct { UserUplink bool `protobuf:"varint,1,opt,name=user_uplink,json=userUplink,proto3" json:"user_uplink,omitempty"` UserDownlink bool `protobuf:"varint,2,opt,name=user_downlink,json=userDownlink,proto3" json:"user_downlink,omitempty"` // contains filtered or unexported fields }
func (*Policy_Stats) Descriptor() ([]byte, []int)
Deprecated: Use Policy_Stats.ProtoReflect.Descriptor instead.
func (x *Policy_Stats) GetUserDownlink() bool
func (x *Policy_Stats) GetUserUplink() bool
func (*Policy_Stats) ProtoMessage()
func (x *Policy_Stats) ProtoReflect() protoreflect.Message
func (x *Policy_Stats) Reset()
func (x *Policy_Stats) String() string
type Policy_Timeout struct { Handshake *Second `protobuf:"bytes,1,opt,name=handshake,proto3" json:"handshake,omitempty"` ConnectionIdle *Second `protobuf:"bytes,2,opt,name=connection_idle,json=connectionIdle,proto3" json:"connection_idle,omitempty"` UplinkOnly *Second `protobuf:"bytes,3,opt,name=uplink_only,json=uplinkOnly,proto3" json:"uplink_only,omitempty"` DownlinkOnly *Second `protobuf:"bytes,4,opt,name=downlink_only,json=downlinkOnly,proto3" json:"downlink_only,omitempty"` // contains filtered or unexported fields }
Timeout is a message for timeout settings in various stages, in seconds.
func (*Policy_Timeout) Descriptor() ([]byte, []int)
Deprecated: Use Policy_Timeout.ProtoReflect.Descriptor instead.
func (x *Policy_Timeout) GetConnectionIdle() *Second
func (x *Policy_Timeout) GetDownlinkOnly() *Second
func (x *Policy_Timeout) GetHandshake() *Second
func (x *Policy_Timeout) GetUplinkOnly() *Second
func (*Policy_Timeout) ProtoMessage()
func (x *Policy_Timeout) ProtoReflect() protoreflect.Message
func (x *Policy_Timeout) Reset()
func (x *Policy_Timeout) String() string
type Second struct { Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Deprecated: Use Second.ProtoReflect.Descriptor instead.
Duration converts Second to time.Duration.
func (x *Second) ProtoReflect() protoreflect.Message
type SystemPolicy struct { Stats *SystemPolicy_Stats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` // contains filtered or unexported fields }
func (*SystemPolicy) Descriptor() ([]byte, []int)
Deprecated: Use SystemPolicy.ProtoReflect.Descriptor instead.
func (x *SystemPolicy) GetStats() *SystemPolicy_Stats
func (*SystemPolicy) ProtoMessage()
func (x *SystemPolicy) ProtoReflect() protoreflect.Message
func (x *SystemPolicy) Reset()
func (x *SystemPolicy) String() string
func (p *SystemPolicy) ToCorePolicy() policy.System
ToCorePolicy converts this SystemPolicy to policy.System.
type SystemPolicy_Stats struct { InboundUplink bool `protobuf:"varint,1,opt,name=inbound_uplink,json=inboundUplink,proto3" json:"inbound_uplink,omitempty"` InboundDownlink bool `protobuf:"varint,2,opt,name=inbound_downlink,json=inboundDownlink,proto3" json:"inbound_downlink,omitempty"` OutboundUplink bool `protobuf:"varint,3,opt,name=outbound_uplink,json=outboundUplink,proto3" json:"outbound_uplink,omitempty"` OutboundDownlink bool `protobuf:"varint,4,opt,name=outbound_downlink,json=outboundDownlink,proto3" json:"outbound_downlink,omitempty"` // contains filtered or unexported fields }
func (*SystemPolicy_Stats) Descriptor() ([]byte, []int)
Deprecated: Use SystemPolicy_Stats.ProtoReflect.Descriptor instead.
func (x *SystemPolicy_Stats) GetInboundDownlink() bool
func (x *SystemPolicy_Stats) GetInboundUplink() bool
func (x *SystemPolicy_Stats) GetOutboundDownlink() bool
func (x *SystemPolicy_Stats) GetOutboundUplink() bool
func (*SystemPolicy_Stats) ProtoMessage()
func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message
func (x *SystemPolicy_Stats) Reset()
func (x *SystemPolicy_Stats) String() string
Package policy imports 10 packages (graph). Updated 2020-12-29. Refresh now. Tools for package owners.