Help us shape the future of Go! Take the 2026 Go Developer Survey

script

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 12 Imported by: 0

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 - путь к своему 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 (e *Engine) HasAccounting() bool

func (*Engine) HasAuthorize

func (e *Engine) HasAuthorize() bool

func (*Engine) HasPostAuth

func (e *Engine) HasPostAuth() bool

func (*Engine) PoolSize

func (e *Engine) PoolSize() int

type Processor

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

Processor реализует radius.Processor поверх встроенных Lua-скриптов

func NewProcessor

func NewProcessor(conf Config, lg *logger.Logger) (*Processor, error)

func (*Processor) Get

func (*Processor) SendAcct

func (p *Processor) SendAcct(acct *events.AcctRequest)

func (*Processor) SendPostAuth

func (p *Processor) SendPostAuth(req events.AuthRequest, resp events.AuthResponse)

Jump to

Keyboard shortcuts

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