mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
rename Read / Write into Unmarshal / Marshal when needed
Read() / Write() are used to read / write from streams, while Unmarshal() / Marshal() are used to decode / encode from / to bytes.
This commit is contained in:
@@ -17,8 +17,8 @@ type Session struct {
|
||||
Timeout *uint
|
||||
}
|
||||
|
||||
// Read decodes a Session header.
|
||||
func (h *Session) Read(v base.HeaderValue) error {
|
||||
// Unmarshal decodes a Session header.
|
||||
func (h *Session) Unmarshal(v base.HeaderValue) error {
|
||||
if len(v) == 0 {
|
||||
return fmt.Errorf("value not provided")
|
||||
}
|
||||
@@ -59,8 +59,8 @@ func (h *Session) Read(v base.HeaderValue) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Write encodes a Session header.
|
||||
func (h Session) Write() base.HeaderValue {
|
||||
// Marshal encodes a Session header.
|
||||
func (h Session) Marshal() base.HeaderValue {
|
||||
ret := h.Session
|
||||
|
||||
if h.Timeout != nil {
|
||||
|
Reference in New Issue
Block a user