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

script

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 14 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 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 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