Source File
compression_method.go
Belonging Package
github.com/pion/dtls/v2/pkg/protocol
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage protocol// CompressionMethodID is the ID for a CompressionMethodtype CompressionMethodID byteconst (compressionMethodNull CompressionMethodID = 0)// CompressionMethod represents a TLS Compression Methodtype CompressionMethod struct {ID CompressionMethodID}// CompressionMethods returns all supported CompressionMethodsfunc () map[CompressionMethodID]*CompressionMethod {return map[CompressionMethodID]*CompressionMethod{compressionMethodNull: {ID: compressionMethodNull},}}// DecodeCompressionMethods the given compression methodsfunc ( []byte) ([]*CompressionMethod, error) {if len() < 1 {return nil, errBufferTooSmall}:= int([0]):= []*CompressionMethod{}for := 0; < ; ++ {if len() <= +1 {return nil, errBufferTooSmall}:= CompressionMethodID([+1])if , := CompressionMethods()[]; {= append(, )}}return , nil}// EncodeCompressionMethods the given compression methodsfunc ( []*CompressionMethod) []byte {:= []byte{byte(len())}for := len(); > 0; -- {= append(, byte([-1].ID))}return}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |