Source File
addr.go
Belonging Package
github.com/pion/turn/v4/internal/proto
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage protoimport ()// Addr is ip:port.type Addr struct {IP net.IPPort int}// Network implements net.Addr.func (Addr) () string { return "turn" }// FromUDPAddr sets addr to UDPAddr.func ( *Addr) ( *net.UDPAddr) {.IP = .IP.Port = .Port}// Equal returns true if b == a.func ( Addr) ( Addr) bool {if .Port != .Port {return false}return .IP.Equal(.IP)}// EqualIP returns true if a and b have equal IP addresses.func ( Addr) ( Addr) bool {return .IP.Equal(.IP)}func ( Addr) () string {return fmt.Sprintf("%s:%d", .IP, .Port)}// FiveTuple represents 5-TUPLE value.type FiveTuple struct {Client AddrServer AddrProto Protocol}func ( FiveTuple) () string {return fmt.Sprintf("%s->%s (%s)",.Client, .Server, .Proto,)}// Equal returns true if b == t.func ( FiveTuple) ( FiveTuple) bool {if .Proto != .Proto {return false}if !.Client.Equal(.Client) {return false}if !.Server.Equal(.Server) {return false}return true}
![]() |
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. |