encodeStreams encodes the streams. It takes the Streams object as an argument and returns the encoded data as a byte slice. Parameters: ss: The Streams object to encode. Returns: []byte: The encoded data as a byte slice. error: An error if any occurred during the encoding process, or nil on s
(ss *Streams)
| 627 | // - If any error occurs during the encoding process, it will be returned along with nil byte slice. |
| 628 | // - On success, it returns the encoded data as a byte slice. |
| 629 | func (s *StreamStructure) encodeStreams(ss *Streams) ([]byte, error) { |
| 630 | // Encode the streams |
| 631 | data, err := json.Marshal(ss) |
| 632 | if err != nil { |
| 633 | return nil, err |
| 634 | } |
| 635 | return data, nil |
| 636 | } |
| 637 | |
| 638 | // decodeStreams decodes the streams. |
| 639 | // It takes the encoded data as a byte slice and the target Streams object as arguments. |