Source File
dtlstransportstate.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtc// DTLSTransportState indicates the DTLS transport establishment state.type DTLSTransportState intconst (// DTLSTransportStateUnknown is the enum's zero-value.DTLSTransportStateUnknown DTLSTransportState = iota// DTLSTransportStateNew indicates that DTLS has not started negotiating// yet.DTLSTransportStateNew// DTLSTransportStateConnecting indicates that DTLS is in the process of// negotiating a secure connection and verifying the remote fingerprint.DTLSTransportStateConnecting// DTLSTransportStateConnected indicates that DTLS has completed// negotiation of a secure connection and verified the remote fingerprint.DTLSTransportStateConnected// DTLSTransportStateClosed indicates that the transport has been closed// intentionally as the result of receipt of a close_notify alert, or// calling close().DTLSTransportStateClosed// DTLSTransportStateFailed indicates that the transport has failed as// the result of an error (such as receipt of an error alert or failure to// validate the remote fingerprint).DTLSTransportStateFailed)// This is done this way because of a linter.const (dtlsTransportStateNewStr = "new"dtlsTransportStateConnectingStr = "connecting"dtlsTransportStateConnectedStr = "connected"dtlsTransportStateClosedStr = "closed"dtlsTransportStateFailedStr = "failed")func newDTLSTransportState( string) DTLSTransportState {switch {case dtlsTransportStateNewStr:return DTLSTransportStateNewcase dtlsTransportStateConnectingStr:return DTLSTransportStateConnectingcase dtlsTransportStateConnectedStr:return DTLSTransportStateConnectedcase dtlsTransportStateClosedStr:return DTLSTransportStateClosedcase dtlsTransportStateFailedStr:return DTLSTransportStateFaileddefault:return DTLSTransportStateUnknown}}func ( DTLSTransportState) () string {switch {case DTLSTransportStateNew:return dtlsTransportStateNewStrcase DTLSTransportStateConnecting:return dtlsTransportStateConnectingStrcase DTLSTransportStateConnected:return dtlsTransportStateConnectedStrcase DTLSTransportStateClosed:return dtlsTransportStateClosedStrcase DTLSTransportStateFailed:return dtlsTransportStateFailedStrdefault:return ErrUnknownType.Error()}}// MarshalText implements encoding.TextMarshaler.func ( DTLSTransportState) () ([]byte, error) {return []byte(.String()), nil}// UnmarshalText implements encoding.TextUnmarshaler.func ( *DTLSTransportState) ( []byte) error {* = newDTLSTransportState(string())return nil}
![]() |
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. |