policy

package
v5.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 10 Imported by: 4

Documentation

Overview

Package policy is an implementation of policy.Manager feature.

Index

Constants

This section is empty.

Variables

View Source
var File_app_policy_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config

type Config struct {
	Level  map[uint32]*Policy `` /* 152-byte string literal not displayed */
	System *SystemPolicy      `protobuf:"bytes,2,opt,name=system,proto3" json:"system,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetLevel

func (x *Config) GetLevel() map[uint32]*Policy

func (*Config) GetSystem

func (x *Config) GetSystem() *SystemPolicy

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance is an instance of Policy manager.

func New

func New(ctx context.Context, config *Config) (*Instance, error)

New creates new Policy manager instance.

func (*Instance) Close

func (m *Instance) Close() error

Close implements common.Closable.Close().

func (*Instance) ForLevel

func (m *Instance) ForLevel(level uint32) policy.Session

ForLevel implements policy.Manager.

func (*Instance) ForSystem

func (m *Instance) ForSystem() policy.System

ForSystem implements policy.Manager.

func (*Instance) Start

func (m *Instance) Start() error

Start implements common.Runnable.Start().

func (*Instance) Type

func (*Instance) Type() interface{}

Type implements common.HasType.

type Policy

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
}

func (*Policy) Descriptor deprecated

func (*Policy) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetBuffer

func (x *Policy) GetBuffer() *Policy_Buffer

func (*Policy) GetStats

func (x *Policy) GetStats() *Policy_Stats

func (*Policy) GetTimeout

func (x *Policy) GetTimeout() *Policy_Timeout

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) String

func (x *Policy) String() string

func (*Policy) ToCorePolicy

func (p *Policy) ToCorePolicy() policy.Session

ToCorePolicy converts this Policy to policy.Session.

type Policy_Buffer

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 deprecated

func (*Policy_Buffer) Descriptor() ([]byte, []int)

Deprecated: Use Policy_Buffer.ProtoReflect.Descriptor instead.

func (*Policy_Buffer) GetConnection

func (x *Policy_Buffer) GetConnection() int32

func (*Policy_Buffer) ProtoMessage

func (*Policy_Buffer) ProtoMessage()

func (*Policy_Buffer) ProtoReflect

func (x *Policy_Buffer) ProtoReflect() protoreflect.Message

func (*Policy_Buffer) Reset

func (x *Policy_Buffer) Reset()

func (*Policy_Buffer) String

func (x *Policy_Buffer) String() string

type Policy_Stats

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 deprecated

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 (*Policy_Stats) ProtoMessage()

func (*Policy_Stats) ProtoReflect

func (x *Policy_Stats) ProtoReflect() protoreflect.Message

func (*Policy_Stats) Reset

func (x *Policy_Stats) Reset()

func (*Policy_Stats) String

func (x *Policy_Stats) String() string

type Policy_Timeout

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 deprecated

func (*Policy_Timeout) Descriptor() ([]byte, []int)

Deprecated: Use Policy_Timeout.ProtoReflect.Descriptor instead.

func (*Policy_Timeout) GetConnectionIdle

func (x *Policy_Timeout) GetConnectionIdle() *Second

func (*Policy_Timeout) GetDownlinkOnly

func (x *Policy_Timeout) GetDownlinkOnly() *Second

func (*Policy_Timeout) GetHandshake

func (x *Policy_Timeout) GetHandshake() *Second

func (*Policy_Timeout) GetUplinkOnly

func (x *Policy_Timeout) GetUplinkOnly() *Second

func (*Policy_Timeout) ProtoMessage

func (*Policy_Timeout) ProtoMessage()

func (*Policy_Timeout) ProtoReflect

func (x *Policy_Timeout) ProtoReflect() protoreflect.Message

func (*Policy_Timeout) Reset

func (x *Policy_Timeout) Reset()

func (*Policy_Timeout) String

func (x *Policy_Timeout) String() string

type Second

type Second struct {
	Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Second) Descriptor deprecated

func (*Second) Descriptor() ([]byte, []int)

Deprecated: Use Second.ProtoReflect.Descriptor instead.

func (*Second) Duration

func (s *Second) Duration() time.Duration

Duration converts Second to time.Duration.

func (*Second) GetValue

func (x *Second) GetValue() uint32

func (*Second) ProtoMessage

func (*Second) ProtoMessage()

func (*Second) ProtoReflect

func (x *Second) ProtoReflect() protoreflect.Message

func (*Second) Reset

func (x *Second) Reset()

func (*Second) String

func (x *Second) String() string

type SystemPolicy

type SystemPolicy struct {
	Stats *SystemPolicy_Stats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemPolicy) Descriptor deprecated

func (*SystemPolicy) Descriptor() ([]byte, []int)

Deprecated: Use SystemPolicy.ProtoReflect.Descriptor instead.

func (*SystemPolicy) GetStats

func (x *SystemPolicy) GetStats() *SystemPolicy_Stats

func (*SystemPolicy) ProtoMessage

func (*SystemPolicy) ProtoMessage()

func (*SystemPolicy) ProtoReflect

func (x *SystemPolicy) ProtoReflect() protoreflect.Message

func (*SystemPolicy) Reset

func (x *SystemPolicy) Reset()

func (*SystemPolicy) String

func (x *SystemPolicy) String() string

func (*SystemPolicy) ToCorePolicy

func (p *SystemPolicy) ToCorePolicy() policy.System

ToCorePolicy converts this SystemPolicy to policy.System.

type SystemPolicy_Stats

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 deprecated

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 (*SystemPolicy_Stats) ProtoMessage()

func (*SystemPolicy_Stats) ProtoReflect

func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message

func (*SystemPolicy_Stats) Reset

func (x *SystemPolicy_Stats) Reset()

func (*SystemPolicy_Stats) String

func (x *SystemPolicy_Stats) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL