mirror of
https://github.com/pion/ice.git
synced 2025-09-26 19:41:11 +08:00
29 lines
686 B
Go
29 lines
686 B
Go
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package ice
|
|
|
|
import "github.com/pion/stun/v3"
|
|
|
|
// UseCandidateAttr represents USE-CANDIDATE attribute.
|
|
type UseCandidateAttr struct{}
|
|
|
|
// AddTo adds USE-CANDIDATE attribute to message.
|
|
func (UseCandidateAttr) AddTo(m *stun.Message) error {
|
|
m.Add(stun.AttrUseCandidate, nil)
|
|
|
|
return nil
|
|
}
|
|
|
|
// IsSet returns true if USE-CANDIDATE attribute is set.
|
|
func (UseCandidateAttr) IsSet(m *stun.Message) bool {
|
|
_, err := m.Get(stun.AttrUseCandidate)
|
|
|
|
return err == nil
|
|
}
|
|
|
|
// UseCandidate is shorthand for UseCandidateAttr.
|
|
func UseCandidate() UseCandidateAttr {
|
|
return UseCandidateAttr{}
|
|
}
|