Documentation
¶
Index ¶
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 sets one script per phase: auth is required, acct and post_auth are optional.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine runs one compiled script on a pool of Lua states.
func NewEngine ¶ added in v0.3.13
func NewEngine(path string, poolSize int, timeout time.Duration, lg *logger.Logger, store *clientdb.Store) (*Engine, error)
NewEngine compiles the script once and prepares poolSize Lua states. A nil store leaves the global db undefined in the script.
func (*Engine) Accounting ¶ added in v0.3.13
func (e *Engine) Accounting(req *events.AcctRequest) error
func (*Engine) Authorize ¶ added in v0.3.13
func (e *Engine) Authorize(req *events.AuthRequest) (*events.AuthResponse, error)
func (*Engine) PostAuth ¶ added in v0.3.13
func (e *Engine) PostAuth(req *events.AuthRequest, resp *events.AuthResponse) error
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor implements radius.Processor with embedded Lua scripts.
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.