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

events

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcctRequest

type AcctRequest struct {
	NasIp           string `json:"nas_ip" yaml:"nas_ip"`
	NasName         string `json:"nas_name" yaml:"nas_name"`
	DeviceMac       string `json:"device_mac"`
	DhcpServerName  string `json:"dhcp_server_name"`
	DhcpServerId    string `json:"dhcp_server_id"`
	FramedIpAddress string `json:"ip_address"`
	AuthType        string `json:"auth_type"`
	Class           string `json:"class_id"`
	StatusType      string `json:"status_type"`
	SessionTime     int64  `json:"session_time"`
	TerminateCause  string `json:"terminate_cause"`
	InputOctets     int64  `json:"input_octets"`
	OutputOctets    int64  `json:"output_octets"`
	PoolName        string `json:"pool_name"`
	SessionId       string `json:"session_id"`
}

type AuthError

type AuthError struct {
	Kind            AuthErrorKind
	Err             error
	ExtraAttributes map[string]string
}

AuthError carries the kind of an authorize() failure. Any other error is KindError.

func (*AuthError) Error

func (e *AuthError) Error() string

func (*AuthError) Unwrap

func (e *AuthError) Unwrap() error

type AuthErrorKind

type AuthErrorKind string

AuthErrorKind tells the radius handler how to answer when authorize() fails. It mirrors the FreeRADIUS module codes used by the legacy Perl script:

  • KindError (RLM_MODULE_FAIL): infrastructure failure unrelated to the request (clientdb down, script crashed, no free worker). No answer is sent, so the NAS retries later.
  • KindInvalid (RLM_MODULE_INVALID): this request cannot be served, e.g. circuit_id did not parse. Answered with Access-Reject.
  • KindReject (RLM_MODULE_REJECT): explicit business decision to deny the device. Answered with Access-Reject.
const (
	KindError   AuthErrorKind = "ERROR"
	KindInvalid AuthErrorKind = "INVALID"
	KindReject  AuthErrorKind = "REJECT"
)

func ClassifyAuthError

func ClassifyAuthError(err error) AuthErrorKind

type AuthRequest

type AuthRequest struct {
	NasIp           string             `json:"nas_ip" yaml:"nas_ip"`
	NasName         string             `json:"nas_name" yaml:"nas_name"`
	DeviceMac       string             `json:"device_mac"`
	DhcpServerName  string             `json:"dhcp_server_name"`
	DhcpServerId    string             `json:"dhcp_server_id"`
	AgentOption     *AuthRequestOption `json:"option"`
	FramedIpAddress string             `json:"ip_address"`
	Class           string             `json:"class_id"`
}

type AuthRequestOption

type AuthRequestOption struct {
	RemoteId     string `json:"remote_id"`
	RawCircuitId string `json:"circuit_id"`
}

type AuthResponse

type AuthResponse struct {
	Time            time.Time         `json:"-"`
	IpAddress       string            `json:"ip_address"`
	PoolName        string            `json:"pool_name"`
	LeaseTimeSec    int               `json:"lease_time_sec"`
	Status          string            `json:"status"`
	Error           string            `json:"error"`
	Class           string            `json:"class_id"`
	ExtraAttributes map[string]string `json:"extra_attributes"`
}

Jump to

Keyboard shortcuts

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