datatypes

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 10, 2014 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Diameter data types.

Index

Constants

This section is empty.

Variables

View Source
var Available = map[string]DataTypeId{
	"Address":          AddressType,
	"DiameterIdentity": DiameterIdentityType,
	"DiameterURI":      DiameterURIType,
	"Enumerated":       EnumeratedType,
	"Float32":          Float32Type,
	"Float64":          Float64Type,
	"Grouped":          GroupedType,
	"IPFilterRule":     IPFilterRuleType,
	"IPv4":             IPv4Type,
	"Integer32":        Integer32Type,
	"Integer64":        Integer64Type,
	"OctetString":      OctetStringType,
	"Time":             TimeType,
	"UTF8String":       UTF8StringType,
	"Unsigned32":       Unsigned32Type,
	"Unsigned64":       Unsigned64Type,
}
View Source
var Decoder = map[DataTypeId]DecoderFunc{
	AddressType:          DecodeAddress,
	DiameterIdentityType: DecodeDiameterIdentity,
	DiameterURIType:      DecodeDiameterURI,
	EnumeratedType:       DecodeEnumerated,
	Float32Type:          DecodeFloat32,
	Float64Type:          DecodeFloat64,
	GroupedType:          DecodeGrouped,
	IPFilterRuleType:     DecodeIPFilterRule,
	IPv4Type:             DecodeIPv4,
	Integer32Type:        DecodeInteger32,
	Integer64Type:        DecodeInteger64,
	OctetStringType:      DecodeOctetString,
	TimeType:             DecodeTime,
	UTF8StringType:       DecodeUTF8String,
	Unsigned32Type:       DecodeUnsigned32,
	Unsigned64Type:       DecodeUnsigned64,
}

Functions

This section is empty.

Types

type Address

type Address net.IP

Address Diameter Type.

func (Address) Len

func (addr Address) Len() int

func (Address) Padding

func (addr Address) Padding() int

func (Address) Serialize

func (addr Address) Serialize() []byte

Serialize returns the byte representation of the Diameter Address. Example:

ip := net.IP(addr.Serialize())

func (Address) String

func (addr Address) String() string

func (Address) Type

func (addr Address) Type() DataTypeId

type DataType

type DataType interface {
	Serialize() []byte
	Len() int
	Padding() int
	Type() DataTypeId
	String() string
}

func Decode

func Decode(datatype DataTypeId, b []byte) (DataType, error)

func DecodeAddress

func DecodeAddress(b []byte) (DataType, error)

DecodeAddress decodes the byte representation of a Diameter Address. Example:

b := Address(net.ParseIP("10.0.0.1"))

func DecodeDiameterIdentity

func DecodeDiameterIdentity(b []byte) (DataType, error)

func DecodeDiameterURI

func DecodeDiameterURI(b []byte) (DataType, error)

func DecodeEnumerated

func DecodeEnumerated(b []byte) (DataType, error)

func DecodeFloat32

func DecodeFloat32(b []byte) (DataType, error)

func DecodeFloat64

func DecodeFloat64(b []byte) (DataType, error)

func DecodeGrouped

func DecodeGrouped(b []byte) (DataType, error)

func DecodeIPFilterRule

func DecodeIPFilterRule(b []byte) (DataType, error)

func DecodeIPv4

func DecodeIPv4(b []byte) (DataType, error)

func DecodeInteger32

func DecodeInteger32(b []byte) (DataType, error)

func DecodeInteger64

func DecodeInteger64(b []byte) (DataType, error)

func DecodeOctetString

func DecodeOctetString(b []byte) (DataType, error)

func DecodeTime

func DecodeTime(b []byte) (DataType, error)

func DecodeUTF8String

func DecodeUTF8String(b []byte) (DataType, error)

func DecodeUnsigned32

func DecodeUnsigned32(b []byte) (DataType, error)

func DecodeUnsigned64

func DecodeUnsigned64(b []byte) (DataType, error)

type DataTypeId

type DataTypeId int
const (
	UnknownType DataTypeId = iota
	AddressType
	DiameterIdentityType
	DiameterURIType
	EnumeratedType
	Float32Type
	Float64Type
	GroupedType
	IPFilterRuleType
	IPv4Type
	Integer32Type
	Integer64Type
	OctetStringType
	TimeType
	UTF8StringType
	Unsigned32Type
	Unsigned64Type
)

type DecoderFunc

type DecoderFunc func([]byte) (DataType, error)

type DiameterIdentity

type DiameterIdentity OctetString

DiameterIdentity Diameter Type.

func (DiameterIdentity) Len

func (s DiameterIdentity) Len() int

func (DiameterIdentity) Padding

func (s DiameterIdentity) Padding() int

func (DiameterIdentity) Serialize

func (s DiameterIdentity) Serialize() []byte

func (DiameterIdentity) String

func (s DiameterIdentity) String() string

func (DiameterIdentity) Type

func (s DiameterIdentity) Type() DataTypeId

type DiameterURI

type DiameterURI OctetString

DiameterURI Diameter Type.

func (DiameterURI) Len

func (s DiameterURI) Len() int

func (DiameterURI) Padding

func (s DiameterURI) Padding() int

func (DiameterURI) Serialize

func (s DiameterURI) Serialize() []byte

func (DiameterURI) String

func (s DiameterURI) String() string

func (DiameterURI) Type

func (s DiameterURI) Type() DataTypeId

type Enumerated

type Enumerated Integer32

Enumerated Diameter Type

func (Enumerated) Len

func (n Enumerated) Len() int

func (Enumerated) Padding

func (n Enumerated) Padding() int

func (Enumerated) Serialize

func (n Enumerated) Serialize() []byte

func (Enumerated) String

func (n Enumerated) String() string

func (Enumerated) Type

func (n Enumerated) Type() DataTypeId

type Float32

type Float32 float32

Float32 Diameter Type

func (Float32) Len

func (n Float32) Len() int

func (Float32) Padding

func (n Float32) Padding() int

func (Float32) Serialize

func (n Float32) Serialize() []byte

func (Float32) String

func (n Float32) String() string

func (Float32) Type

func (n Float32) Type() DataTypeId

type Float64

type Float64 float64

Float64 Diameter Type

func (Float64) Len

func (n Float64) Len() int

func (Float64) Padding

func (n Float64) Padding() int

func (Float64) Serialize

func (n Float64) Serialize() []byte

func (Float64) String

func (n Float64) String() string

func (Float64) Type

func (n Float64) Type() DataTypeId

type Grouped

type Grouped []byte

Grouped Diameter Type

func (Grouped) Len

func (g Grouped) Len() int

func (Grouped) Padding

func (g Grouped) Padding() int

func (Grouped) Serialize

func (g Grouped) Serialize() []byte

func (Grouped) String

func (g Grouped) String() string

func (Grouped) Type

func (g Grouped) Type() DataTypeId

type IPFilterRule

type IPFilterRule OctetString

IPFilterRule Diameter Type.

func (IPFilterRule) Len

func (s IPFilterRule) Len() int

func (IPFilterRule) Padding

func (s IPFilterRule) Padding() int

func (IPFilterRule) Serialize

func (s IPFilterRule) Serialize() []byte

func (IPFilterRule) String

func (s IPFilterRule) String() string

func (IPFilterRule) Type

func (s IPFilterRule) Type() DataTypeId

type IPv4

type IPv4 net.IP

IPv4 Diameter Type for Framed-IP-Address AVP.

func (IPv4) Len

func (ip IPv4) Len() int

func (IPv4) Padding

func (ip IPv4) Padding() int

func (IPv4) Serialize

func (ip IPv4) Serialize() []byte

func (IPv4) String

func (ip IPv4) String() string

func (IPv4) Type

func (ip IPv4) Type() DataTypeId

type Integer32

type Integer32 int32

Integer32 Diameter Type

func (Integer32) Len

func (n Integer32) Len() int

func (Integer32) Padding

func (n Integer32) Padding() int

func (Integer32) Serialize

func (n Integer32) Serialize() []byte

func (Integer32) String

func (n Integer32) String() string

func (Integer32) Type

func (n Integer32) Type() DataTypeId

type Integer64

type Integer64 int64

Integer64 Diameter Type

func (Integer64) Len

func (n Integer64) Len() int

func (Integer64) Padding

func (n Integer64) Padding() int

func (Integer64) Serialize

func (n Integer64) Serialize() []byte

func (Integer64) String

func (n Integer64) String() string

func (Integer64) Type

func (n Integer64) Type() DataTypeId

type OctetString

type OctetString string

OctetString Diameter Type.

func (OctetString) Len

func (s OctetString) Len() int

func (OctetString) Padding

func (s OctetString) Padding() int

func (OctetString) Serialize

func (s OctetString) Serialize() []byte

func (OctetString) String

func (s OctetString) String() string

func (OctetString) Type

func (s OctetString) Type() DataTypeId

type Time

type Time time.Time

Time Diameter Type.

func (Time) Len

func (t Time) Len() int

func (Time) Padding

func (t Time) Padding() int

func (Time) Serialize

func (t Time) Serialize() []byte

func (Time) String

func (t Time) String() string

func (Time) Type

func (t Time) Type() DataTypeId

type UTF8String

type UTF8String OctetString

UTF8String Diameter Type.

func (UTF8String) Len

func (s UTF8String) Len() int

func (UTF8String) Padding

func (s UTF8String) Padding() int

func (UTF8String) Serialize

func (s UTF8String) Serialize() []byte

func (UTF8String) String

func (s UTF8String) String() string

func (UTF8String) Type

func (s UTF8String) Type() DataTypeId

type Unsigned32

type Unsigned32 uint32

Unsigned32 Diameter Type

func (Unsigned32) Len

func (n Unsigned32) Len() int

func (Unsigned32) Padding

func (n Unsigned32) Padding() int

func (Unsigned32) Serialize

func (n Unsigned32) Serialize() []byte

func (Unsigned32) String

func (n Unsigned32) String() string

func (Unsigned32) Type

func (n Unsigned32) Type() DataTypeId

type Unsigned64

type Unsigned64 uint64

Unsigned64 Diameter Type

func (Unsigned64) Len

func (n Unsigned64) Len() int

func (Unsigned64) Padding

func (n Unsigned64) Padding() int

func (Unsigned64) Serialize

func (n Unsigned64) Serialize() []byte

func (Unsigned64) String

func (n Unsigned64) String() string

func (Unsigned64) Type

func (n Unsigned64) Type() DataTypeId

Jump to

Keyboard shortcuts

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