turngrant

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package turngrant defines the session's network-independent credential issuance contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenewalLead

func RenewalLead(lifetime time.Duration) time.Duration

RenewalLead leaves a quarter of a short credential's lifetime for renewal while avoiding unnecessary issuance early in a long-lived grant.

Types

type Credential

type Credential struct {
	ServiceID          string
	URLs               []string
	Username, Password string
	// The issuer owns expiry. Waiting for sibling issuers cannot extend a credential.
	// A zero deadline is reserved for explicitly static credentials.
	ExpiresAt time.Time
}

type IssueRequest

type IssueRequest struct {
	Trace      Trace
	Mode       p.TURNMode
	ServiceIDs []string
	Reusable   map[string]bool
}

Reusable contains only live grants already owned by the requesting session.

type IssueResult

type IssueResult struct {
	Retained    []string
	Status      p.TURNStatus
	HasFallback bool
	Credentials []Credential
}

type Trace

type Trace struct {
	Sink    d.Sink
	Session p.ProtocolSessionID
}

Trace carries the task recorder across issuing and negotiation. Credentials, ICE URLs and bearer tokens never enter diagnostic records.

func (Trace) Event

func (t Trace) Event(name, service string, fields d.Fields)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL