Documentation ¶
Overview ¶
Package datatype provides data types for Diameter AVPs.
Index ¶
- Variables
- type Address
- type DecoderFunc
- type DiameterIdentity
- type DiameterURI
- type Enumerated
- type Float32
- type Float64
- type Grouped
- type IPFilterRule
- type IPv4
- type IPv6
- type Integer32
- type Integer64
- type OctetString
- type QoSFilterRule
- type Time
- type Type
- func Decode(Type TypeID, b []byte) (Type, error)
- func DecodeAddress(b []byte) (Type, error)
- func DecodeDiameterIdentity(b []byte) (Type, error)
- func DecodeDiameterURI(b []byte) (Type, error)
- func DecodeEnumerated(b []byte) (Type, error)
- func DecodeFloat32(b []byte) (Type, error)
- func DecodeFloat64(b []byte) (Type, error)
- func DecodeGrouped(b []byte) (Type, error)
- func DecodeIPFilterRule(b []byte) (Type, error)
- func DecodeIPv4(b []byte) (Type, error)
- func DecodeIPv6(b []byte) (Type, error)
- func DecodeInteger32(b []byte) (Type, error)
- func DecodeInteger64(b []byte) (Type, error)
- func DecodeOctetString(b []byte) (Type, error)
- func DecodeQoSFilterRule(b []byte) (Type, error)
- func DecodeTime(b []byte) (Type, error)
- func DecodeUTF8String(b []byte) (Type, error)
- func DecodeUnknown(b []byte) (Type, error)
- func DecodeUnsigned32(b []byte) (Type, error)
- func DecodeUnsigned64(b []byte) (Type, error)
- type TypeID
- type UTF8String
- type Unknown
- type Unsigned32
- type Unsigned64
Constants ¶
This section is empty.
Variables ¶
var Available = map[string]TypeID{ "Address": AddressType, "DiameterIdentity": DiameterIdentityType, "DiameterURI": DiameterURIType, "Enumerated": EnumeratedType, "Float32": Float32Type, "Float64": Float64Type, "Grouped": GroupedType, "IPFilterRule": IPFilterRuleType, "IPv4": IPv4Type, "IPv6": IPv6Type, "Integer32": Integer32Type, "Integer64": Integer64Type, "OctetString": OctetStringType, "QoSFilterRule": QoSFilterRuleType, "Time": TimeType, "UTF8String": UTF8StringType, "Unsigned32": Unsigned32Type, "Unsigned64": Unsigned64Type, }
Available is a map of data types available, indexed by name.
var Decoder = map[TypeID]DecoderFunc{ UnknownType: DecodeUnknown, 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, }
Decoder is a map of AVP data types indexed by TypeID.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address []byte
Address data type.
type DecoderFunc ¶
DecoderFunc is an adapter to decode a byte array to an AVP data type.
type DiameterIdentity ¶
type DiameterIdentity OctetString
DiameterIdentity data type.
func (DiameterIdentity) Len ¶
func (s DiameterIdentity) Len() int
Len implements the Type interface.
func (DiameterIdentity) Padding ¶
func (s DiameterIdentity) Padding() int
Padding implements the Type interface.
func (DiameterIdentity) Serialize ¶
func (s DiameterIdentity) Serialize() []byte
Serialize implements the Type interface.
func (DiameterIdentity) String ¶
func (s DiameterIdentity) String() string
String implements the Type interface.
func (DiameterIdentity) Type ¶
func (s DiameterIdentity) Type() TypeID
Type implements the Type interface.
type DiameterURI ¶
type DiameterURI OctetString
DiameterURI data type.
func (DiameterURI) Padding ¶
func (s DiameterURI) Padding() int
Padding implements the Type interface.
func (DiameterURI) Serialize ¶
func (s DiameterURI) Serialize() []byte
Serialize implements the Type interface.
func (DiameterURI) String ¶
func (s DiameterURI) String() string
String implements the Type interface.
type Enumerated ¶
type Enumerated Integer32
Enumerated data type.
func (Enumerated) Padding ¶
func (n Enumerated) Padding() int
Padding implements the Type interface.
func (Enumerated) Serialize ¶
func (n Enumerated) Serialize() []byte
Serialize implements the Type interface.
func (Enumerated) String ¶
func (n Enumerated) String() string
String implements the Type interface.
type Float32 ¶
type Float32 float32
Float32 data type.
type Float64 ¶
type Float64 float64
Float64 data type.
type Grouped ¶
type Grouped []byte
Grouped data type.
type IPFilterRule ¶
type IPFilterRule OctetString
IPFilterRule data type.
func (IPFilterRule) Padding ¶
func (s IPFilterRule) Padding() int
Padding implements the Type interface.
func (IPFilterRule) Serialize ¶
func (s IPFilterRule) Serialize() []byte
Serialize implements the Type interface.
func (IPFilterRule) String ¶
func (s IPFilterRule) String() string
String implements the Type interface.
type IPv6 ¶ added in v4.0.2
IPv6 data type for Framed-IP-Address AVP.
type Integer32 ¶
type Integer32 int32
Integer32 data type.
type Integer64 ¶
type Integer64 int64
Integer64 data type.
type OctetString ¶
type OctetString string
OctetString data type.
func (OctetString) Padding ¶
func (s OctetString) Padding() int
Padding implements the Type interface.
func (OctetString) Serialize ¶
func (s OctetString) Serialize() []byte
Serialize implements the Type interface.
func (OctetString) String ¶
func (s OctetString) String() string
String implements the Type interface.
type QoSFilterRule ¶
type QoSFilterRule OctetString
QoSFilterRule data type.
func (QoSFilterRule) Padding ¶
func (s QoSFilterRule) Padding() int
Padding implements the Type interface.
func (QoSFilterRule) Serialize ¶
func (s QoSFilterRule) Serialize() []byte
Serialize implements the Type interface.
func (QoSFilterRule) String ¶
func (s QoSFilterRule) String() string
String implements the Type interface.
func (QoSFilterRule) Type ¶
func (s QoSFilterRule) Type() TypeID
Type implements the Type interface.
type Type ¶
Type is an interface to support Diameter AVP data types.
func DecodeAddress ¶
DecodeAddress decodes an Address data type from byte array.
func DecodeDiameterIdentity ¶
DecodeDiameterIdentity decodes a DiameterIdentity from byte array.
func DecodeDiameterURI ¶
DecodeDiameterURI decodes a DiameterURI from byte array.
func DecodeEnumerated ¶
DecodeEnumerated decodes an Enumerated data type from byte array.
func DecodeFloat32 ¶
DecodeFloat32 decodes a Float32 data type from a byte array.
func DecodeFloat64 ¶
DecodeFloat64 decodes a Float64 data type from byte array.
func DecodeGrouped ¶
DecodeGrouped decodes a Grouped data type from byte array.
func DecodeIPFilterRule ¶
DecodeIPFilterRule decodes an IPFilterRule data type from byte array.
func DecodeIPv4 ¶
DecodeIPv4 decodes an IPv4 data type from byte array.
func DecodeIPv6 ¶ added in v4.0.2
DecodeIPv6 decodes an IPv4 data type from byte array.
func DecodeInteger32 ¶
DecodeInteger32 decodes an Integer32 data type from byte array.
func DecodeInteger64 ¶
DecodeInteger64 decodes an Integer64 data type from byte array.
func DecodeOctetString ¶
DecodeOctetString decodes an OctetString from byte array.
func DecodeQoSFilterRule ¶
DecodeQoSFilterRule decodes an QoSFilterRule data type from byte array.
func DecodeTime ¶
DecodeTime decodes a Time data type from byte array.
func DecodeUTF8String ¶
DecodeUTF8String decodes an UTF8String data type from byte array.
func DecodeUnknown ¶
DecodeUnknown decodes an Unknown from byte array.
func DecodeUnsigned32 ¶
DecodeUnsigned32 decodes an Unsigned32 data type from byte array.
func DecodeUnsigned64 ¶
DecodeUnsigned64 decodes an Unsigned64 data type from byte array.
type TypeID ¶
type TypeID int
TypeID is the identifier of an AVP data type.
const ( UnknownType TypeID = iota AddressType DiameterIdentityType DiameterURIType EnumeratedType Float32Type Float64Type GroupedType IPFilterRuleType IPv4Type Integer32Type Integer64Type OctetStringType QoSFilterRuleType TimeType UTF8StringType Unsigned32Type Unsigned64Type IPv6Type )
List of available AVP data types.
type UTF8String ¶
type UTF8String OctetString
UTF8String data type.
func (UTF8String) Padding ¶
func (s UTF8String) Padding() int
Padding implements the Type interface.
func (UTF8String) Serialize ¶
func (s UTF8String) Serialize() []byte
Serialize implements the Type interface.
func (UTF8String) String ¶
func (s UTF8String) String() string
String implements the Type interface.
type Unknown ¶
type Unknown []byte
Unknown data type.
type Unsigned32 ¶
type Unsigned32 uint32
Unsigned32 data type.
func (Unsigned32) Padding ¶
func (n Unsigned32) Padding() int
Padding implements the Type interface.
func (Unsigned32) Serialize ¶
func (n Unsigned32) Serialize() []byte
Serialize implements the Type interface.
func (Unsigned32) String ¶
func (n Unsigned32) String() string
String implements the Type interface.
type Unsigned64 ¶
type Unsigned64 uint64
Unsigned64 data type.
func (Unsigned64) Padding ¶
func (n Unsigned64) Padding() int
Padding implements the Type interface.
func (Unsigned64) Serialize ¶
func (n Unsigned64) Serialize() []byte
Serialize implements the Type interface.
func (Unsigned64) String ¶
func (n Unsigned64) String() string
String implements the Type interface.