Source File
role.go
Belonging Package
github.com/pion/ice/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage iceimport ()// Role represents ICE agent role, which can be controlling or controlled.type Role byte// Possible ICE agent roles.const (Controlling Role = iotaControlled)// UnmarshalText implements TextUnmarshaler.func ( *Role) ( []byte) error {switch string() {case "controlling":* = Controllingcase "controlled":* = Controlleddefault:return fmt.Errorf("%w %q", errUnknownRole, )}return nil}// MarshalText implements TextMarshaler.func ( Role) () ( []byte, error) {return []byte(.String()), nil}func ( Role) () string {switch {case Controlling:return "controlling"case Controlled:return "controlled"default:return "unknown"}}
![]() |
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. |