Source File
permission.go
Belonging Package
github.com/pion/turn/v4/internal/allocation
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage allocationimport ()const permissionTimeout = time.Duration(5) * time.Minute// Permission represents a TURN permission. TURN permissions mimic the address-restricted// filtering mechanism of NATs that comply with [RFC4787].// See: https://tools.ietf.org/html/rfc5766#section-2.3type Permission struct {Addr net.Addrallocation *AllocationlifetimeTimer *time.Timerlog logging.LeveledLogger}// NewPermission create a new Permission.func ( net.Addr, logging.LeveledLogger) *Permission {return &Permission{Addr: ,log: ,}}func ( *Permission) ( time.Duration) {.lifetimeTimer = time.AfterFunc(, func() {.allocation.RemovePermission(.Addr)})}func ( *Permission) ( time.Duration) {if !.lifetimeTimer.Reset() {.log.Errorf("Failed to reset permission timer for %v %v", .Addr, .allocation.fiveTuple)}}
![]() |
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. |