Documentation
¶
Index ¶
- type Config
- type Engine
- func (e *Engine) CallAccounting(req *events.AcctRequest) error
- func (e *Engine) CallAuthorize(req *events.AuthRequest) (*events.AuthResponse, error)
- func (e *Engine) CallPostAuth(req *events.AuthRequest, resp *events.AuthResponse) error
- func (e *Engine) HasAccounting() bool
- func (e *Engine) HasAuthorize() bool
- func (e *Engine) HasPostAuth() bool
- func (e *Engine) PoolSize() int
- type Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
PoolSize int `yaml:"pool_size"`
Timeout time.Duration `yaml:"timeout"`
Auth string `yaml:"auth"`
Acct string `yaml:"acct"`
PostAuth string `yaml:"post_auth"`
Database clientdb.Config `yaml:"database"`
}
Config - путь к своему lua-скрипту на каждый метод (auth обязателен, acct/post_auth опциональны). pool_size/timeout общие для всех сконфигурированных скриптов.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func New ¶
func New(path string, poolSize int, timeout time.Duration, lg *logger.Logger, store *clientdb.Store) (*Engine, error)
New компилирует скрипт path один раз и прогревает пул из poolSize Lua-состояний. store может быть nil - тогда глобальная переменная db в скрипте не создаётся
func (*Engine) CallAccounting ¶
func (e *Engine) CallAccounting(req *events.AcctRequest) error
func (*Engine) CallAuthorize ¶
func (e *Engine) CallAuthorize(req *events.AuthRequest) (*events.AuthResponse, error)
func (*Engine) CallPostAuth ¶
func (e *Engine) CallPostAuth(req *events.AuthRequest, resp *events.AuthResponse) error
func (*Engine) HasAccounting ¶
func (*Engine) HasAuthorize ¶
func (*Engine) HasPostAuth ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor реализует radius.Processor поверх встроенных Lua-скриптов
func (*Processor) Get ¶
func (p *Processor) Get(req *events.AuthRequest) (*events.AuthResponse, error)
func (*Processor) SendAcct ¶
func (p *Processor) SendAcct(acct *events.AcctRequest)
func (*Processor) SendPostAuth ¶
func (p *Processor) SendPostAuth(req events.AuthRequest, resp events.AuthResponse)
Click to show internal directories.
Click to hide internal directories.