Versions in this module Expand all Collapse all v1 v1.0.1 Jul 20, 2023 Changes in this version + var ErrFailedToDecodeIP = errors.New("invalid IP") + func NTPToTime(v uint64) time.Time + func TimeToNTP(t time.Time) uint64 + type Attribute struct + Key string + Value string + type Attributes []Attribute + func (a Attributes) Flag(flag string) bool + func (a Attributes) Value(attribute string) string + func (a Attributes) Values(attribute string) []string + type BandwidthType string + const BandwidthApplicationSpecific + const BandwidthApplicationSpecificTransportIndependent + const BandwidthConferenceTotal + type Bandwidths map[BandwidthType]int + type ConnectionData struct + AddressType string + Addresses byte + IP net.IP + NetworkType string + TTL byte + func (c ConnectionData) Blank() bool + func (c ConnectionData) ConnectionAddress() string + func (c ConnectionData) Equal(b ConnectionData) bool + func (c ConnectionData) String() string + type DecodeError struct + Place string + Reason string + func (e DecodeError) Error() string + type Decoder struct + func NewDecoder(s Session) Decoder + func (d *Decoder) Decode(m *Message) error + type Encryption struct + Key string + Method string + func (e Encryption) Blank() bool + func (e Encryption) Equal(b Encryption) bool + type Line struct + Type Type + Value []byte + func (l *Line) Decode(b []byte) error + func (l Line) AppendTo(b []byte) []byte + func (l Line) Equal(b Line) bool + func (l Line) String() string + type Media struct + Attributes Attributes + Bandwidths Bandwidths + Connection ConnectionData + Description MediaDescription + Encryption Encryption + Title string + func (m *Media) AddAttribute(k string, values ...string) + func (m *Media) AddFlag(f string) + func (m *Media) Attribute(k string) string + func (m *Media) Flag(f string) bool + func (m *Media) PayloadFormat(payloadType string) string + type MediaDescription struct + Formats []string + Port int + PortsNumber int + Protocol string + Type string + func (m MediaDescription) Equal(b MediaDescription) bool + type Medias []Media + type Message struct + Attributes Attributes + BandwidthType BandwidthType + Bandwidths map[BandwidthType]int + Connection ConnectionData + Email string + Encryption Encryption + Info string + Medias Medias + Name string + Origin Origin + Phone string + TZAdjustments []TimeZone + Timing []Timing + URI string + Version int + func Decode(b []byte) (*Message, error) + func (m *Message) AddAttribute(k, v string) + func (m *Message) AddFlag(f string) + func (m *Message) Append(s Session) Session + func (m *Message) Attribute(attribute string) string + func (m *Message) End() time.Time + func (m *Message) Flag(flag string) bool + func (m *Message) Start() time.Time + type Origin struct + Address string + AddressType string + NetworkType string + SessionID int64 + SessionVersion int64 + Username string + func (o *Origin) Equal(b Origin) bool + type RtpMap struct + Format string + Rate int + Type int + func NewRtpMap(typ int, format string, rate int) *RtpMap + func ParseRtpMap(s string) (*RtpMap, error) + func (m *RtpMap) String() string + type Session []Line + func DecodeSession(b []byte, s Session) (Session, error) + func (s Session) AddAttribute(attribute string, values ...string) Session + func (s Session) AddBandwidth(t BandwidthType, bandwidth int) Session + func (s Session) AddConnectionData(data ConnectionData) Session + func (s Session) AddConnectionDataIP(ip net.IP) Session + func (s Session) AddEmail(email string) Session + func (s Session) AddEncryption(e Encryption) Session + func (s Session) AddEncryptionKey(method, key string) Session + func (s Session) AddEncryptionMethod(method string) Session + func (s Session) AddFlag(attribute string) Session + func (s Session) AddLine(t Type, v string) Session + func (s Session) AddMediaDescription(m MediaDescription) Session + func (s Session) AddOrigin(o Origin) Session + func (s Session) AddPhone(phone string) Session + func (s Session) AddRaw(k rune, v string) Session + func (s Session) AddRepeatTimes(interval, duration time.Duration, offsets ...time.Duration) Session + func (s Session) AddRepeatTimesCompact(interval, duration time.Duration, offsets ...time.Duration) Session + func (s Session) AddSessionInfo(info string) Session + func (s Session) AddSessionName(name string) Session + func (s Session) AddTimeZones(zones ...TimeZone) Session + func (s Session) AddTiming(start, end time.Time) Session + func (s Session) AddTimingNTP(start, end uint64) Session + func (s Session) AddURI(uri string) Session + func (s Session) AddVersion(version int) Session + func (s Session) AppendTo(b []byte) []byte + func (s Session) Equal(b Session) bool + type TimeZone struct + Offset time.Duration + Start time.Time + type Timing struct + Active time.Duration + End time.Time + Offsets []time.Duration + Repeat time.Duration + Start time.Time + type Type rune + const TypeAttribute + const TypeBandwidth + const TypeConnectionData + const TypeEmail + const TypeEncryptionKey + const TypeMediaDescription + const TypeOrigin + const TypePhone + const TypeProtocolVersion + const TypeRepeatTimes + const TypeSessionInformation + const TypeSessionName + const TypeTimeZones + const TypeTiming + const TypeURI + func (t Type) String() string