Versions in this module Expand all Collapse all v1 v1.0.0 Jun 9, 2017 Changes in this version + type Attribute struct + Type byte + Value interface{} + type AttributeCodec interface + Decode func(packet *Packet, wire []byte) (interface{}, error) + Encode func(packet *Packet, value interface{}) ([]byte, error) + var AttributeAddress AttributeCodec + var AttributeAddress6 AttributeCodec + var AttributeInteger AttributeCodec + var AttributeString AttributeCodec + var AttributeText AttributeCodec + var AttributeTime AttributeCodec + var AttributeUnknown AttributeCodec + type Client struct + DialTimeout time.Duration + LocalAddr net.Addr + Net string + ReadTimeout time.Duration + Retry time.Duration + WriteTimeout time.Duration + func (c *Client) Exchange(packet *Packet, addr string) (*Packet, error) + type Code byte + const CodeAccessAccept + const CodeAccessChallenge + const CodeAccessReject + const CodeAccessRequest + const CodeAccountingRequest + const CodeAccountingResponse + const CodeDisconnectAck + const CodeDisconnectNak + const CodeDisconnectRequest + const CodeReserved + const CodeStatusClient + const CodeStatusServer + type Dictionary struct + var Builtin *Dictionary + func (d *Dictionary) Attr(name string, value interface{}) (*Attribute, error) + func (d *Dictionary) Codec(t byte) AttributeCodec + func (d *Dictionary) MustAttr(name string, value interface{}) *Attribute + func (d *Dictionary) MustRegister(name string, t byte, codec AttributeCodec) + func (d *Dictionary) Name(t byte) (name string, ok bool) + func (d *Dictionary) Register(name string, t byte, codec AttributeCodec) error + func (d *Dictionary) Type(name string) (t byte, ok bool) + type Handler interface + ServeRADIUS func(w ResponseWriter, p *Packet) + type HandlerFunc func(w ResponseWriter, p *Packet) + func (h HandlerFunc) ServeRADIUS(w ResponseWriter, p *Packet) + type Packet struct + Attributes []*Attribute + Authenticator [16]byte + Code Code + Dictionary *Dictionary + Identifier byte + Secret []byte + func New(code Code, secret []byte) *Packet + func Parse(data, secret []byte, dictionary *Dictionary) (*Packet, error) + func (p *Packet) Add(name string, value interface{}) error + func (p *Packet) AddAttr(attribute *Attribute) + func (p *Packet) Attr(name string) *Attribute + func (p *Packet) ClearAttributes() + func (p *Packet) Encode() ([]byte, error) + func (p *Packet) IsAuthentic(request *Packet) bool + func (p *Packet) PAP() (username, password string, ok bool) + func (p *Packet) Set(name string, value interface{}) error + func (p *Packet) String(name string) string + func (p *Packet) Value(name string) interface{} + type ResponseWriter interface + AccessAccept func(attributes ...*Attribute) error + AccessChallenge func(attributes ...*Attribute) error + AccessReject func(attributes ...*Attribute) error + LocalAddr func() net.Addr + RemoteAddr func() net.Addr + Write func(packet *Packet) error + type Server struct + Addr string + Dictionary *Dictionary + Handler Handler + Network string + Secret []byte + func (s *Server) ListenAndServe() error + func (s *Server) Serve(pc net.PacketConn) error + type VendorSpecific struct + Data []byte + VendorID uint32