dictionary

package
v0.0.0-...-04c7e6b Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dictionary parses FreeRADIUS dictionary files.

API is currently unstable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortAttributes

func SortAttributes(attrs []*Attribute)

func SortValues

func SortValues(values []*Value)

func SortVendors

func SortVendors(vendors []*Vendor)

Types

type Attribute

type Attribute struct {
	Name string
	OID  string
	Type AttributeType

	Size *int

	FlagEncrypt *int
	FlagHasTag  *bool
	FlagConcat  *bool
}

type AttributeType

type AttributeType int
const (
	AttributeString AttributeType = iota + 1
	AttributeOctets
	AttributeIPAddr
	AttributeDate
	AttributeInteger
	AttributeIPv6Addr
	AttributeIPv6Prefix
	AttributeIFID
	AttributeInteger64

	AttributeVSA
)

func (AttributeType) String

func (t AttributeType) String() string

type BeginVendorIncludeError

type BeginVendorIncludeError struct {
}

func (*BeginVendorIncludeError) Error

func (e *BeginVendorIncludeError) Error() string

type Dictionary

type Dictionary struct {
	Attributes []*Attribute
	Values     []*Value
	Vendors    []*Vendor
}

func (*Dictionary) AttributeByName

func (d *Dictionary) AttributeByName(name string) *Attribute

func (*Dictionary) VendorByName

func (d *Dictionary) VendorByName(name string) *Vendor

type DuplicateAttributeError

type DuplicateAttributeError struct {
	Attribute *Attribute
}

func (*DuplicateAttributeError) Error

func (e *DuplicateAttributeError) Error() string

type DuplicateAttributeFlagError

type DuplicateAttributeFlagError struct {
	Flag string
}

func (*DuplicateAttributeFlagError) Error

type DuplicateVendorError

type DuplicateVendorError struct {
	Vendor *Vendor
}

func (*DuplicateVendorError) Error

func (e *DuplicateVendorError) Error() string

type File

type File interface {
	io.Reader
	io.Closer
	Name() string
}

type FileSystemOpener

type FileSystemOpener struct {
}

func (*FileSystemOpener) OpenFile

func (f *FileSystemOpener) OpenFile(name string) (File, error)

type InvalidAttributeEncryptTypeError

type InvalidAttributeEncryptTypeError struct {
	Type string
}

func (*InvalidAttributeEncryptTypeError) Error

type InvalidEndVendorError

type InvalidEndVendorError struct {
	Vendor string
}

func (*InvalidEndVendorError) Error

func (e *InvalidEndVendorError) Error() string

type InvalidVendorFormatError

type InvalidVendorFormatError struct {
	Format string
}

func (*InvalidVendorFormatError) Error

func (e *InvalidVendorFormatError) Error() string

type NestedVendorBlockError

type NestedVendorBlockError struct {
}

func (*NestedVendorBlockError) Error

func (e *NestedVendorBlockError) Error() string

type Opener

type Opener interface {
	OpenFile(name string) (File, error)
}

type ParseError

type ParseError struct {
	Inner error
	File  File
	Line  int
}

func (*ParseError) Error

func (e *ParseError) Error() string

type Parser

type Parser struct {
	Opener Opener
}

func (*Parser) Parse

func (p *Parser) Parse(f File) (*Dictionary, error)

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (*Dictionary, error)

type RecursiveIncludeError

type RecursiveIncludeError struct {
	Filename string
}

func (*RecursiveIncludeError) Error

func (e *RecursiveIncludeError) Error() string

type UnclosedVendorBlockError

type UnclosedVendorBlockError struct {
}

func (*UnclosedVendorBlockError) Error

func (e *UnclosedVendorBlockError) Error() string

type UnknownAttributeFlagError

type UnknownAttributeFlagError struct {
	Flag string
}

func (*UnknownAttributeFlagError) Error

func (e *UnknownAttributeFlagError) Error() string

type UnknownAttributeTypeError

type UnknownAttributeTypeError struct {
	Type string
}

func (*UnknownAttributeTypeError) Error

func (e *UnknownAttributeTypeError) Error() string

type UnknownLineError

type UnknownLineError struct {
	Line string
}

func (*UnknownLineError) Error

func (e *UnknownLineError) Error() string

type UnknownVendorError

type UnknownVendorError struct {
	Vendor string
}

func (*UnknownVendorError) Error

func (e *UnknownVendorError) Error() string

type UnmatchedEndVendorError

type UnmatchedEndVendorError struct {
}

func (*UnmatchedEndVendorError) Error

func (e *UnmatchedEndVendorError) Error() string

type Value

type Value struct {
	Attribute string
	Name      string
	Number    int
}

type Vendor

type Vendor struct {
	Name   string
	Number int

	TypeOctets   int
	LengthOctets int

	Attributes []*Attribute
	Values     []*Value
}

func (*Vendor) AttributeByName

func (v *Vendor) AttributeByName(name string) *Attribute

Jump to

Keyboard shortcuts

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