pkg

package
v0.0.0-...-7fabc03 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRelayTTL = 1 * time.Hour
)

Variables

View Source
var (
	DefaultExponentialBackoff = ExponentialBackoff{
		Factor:   1.5,
		Maximum:  1 * time.Minute,
		Initial:  1 * time.Second,
		Duration: 1 * time.Second,
	}
)

Functions

This section is empty.

Types

type CandidateMessage

type CandidateMessage struct {
	Spd string `json:"spd"`
	Mid string `json:"mid"`
}

type ControlMessage

type ControlMessage struct {
	PeerID int32  `json:"peer_id"`
	Peers  []Peer `json:"peers"`
}

type DescriptionMessage

type DescriptionMessage struct {
	Spd  string `json:"spd"`
	Type string `json:"type"`
}

type ExponentialBackoff

type ExponentialBackoff struct {
	Factor  float32
	Maximum time.Duration
	Initial time.Duration

	Duration time.Duration
}

func (*ExponentialBackoff) Next

func (e *ExponentialBackoff) Next() time.Duration

func (*ExponentialBackoff) Reset

func (e *ExponentialBackoff) Reset()

type Peer

type Peer struct {
	Name      string    `json:"name"`
	ID        int32     `json:"id,omitempty"`
	Remote    string    `json:"remote,omitempty"`
	UserAgent string    `json:"user_agent,omitempty"`
	Created   time.Time `json:"created"`
	Connected time.Time `json:"connected,omitempty"`
	Signals   []Signal  `json:"signals,omitempty"`
}

type Relay

type Relay struct {
	URL      string `json:"url"`
	Username string `json:"user"`
	Password string `json:"pass"`
	Realm    string `json:"realm"`
	Expires  string `json:"expires"`
}

type RelayInfo

type RelayInfo struct {
	URL   string
	Realm string

	Username string
	Password string

	TTL    time.Duration
	Secret string
}

func NewRelayInfo

func NewRelayInfo(arg string) (RelayInfo, error)

func NewRelayInfos

func NewRelayInfos(args []string) ([]RelayInfo, error)

func (*RelayInfo) GetCredentials

func (s *RelayInfo) GetCredentials(username string) (string, string, time.Time)

type Session

type Session struct {
	Name    string    `json:"name"`
	Created time.Time `json:"created"`
	Peers   []Peer    `json:"peers"`
}

type Signal

type Signal struct {
	Name string     `json:"name"`
	Type SignalType `json:"type"`
	Unit string     `json:"unit,omitempty"`
	Init any        `json:"init,omitempty"`
}

type SignalType

type SignalType string
const (
	SignalTypeFloat   SignalType = "float"
	SignalTypeInteger SignalType = "integer"
	SignalTypeBoolean SignalType = "boolean"
	SignalTypeComplex SignalType = "complex"
)

type SignalingMessage

type SignalingMessage struct {
	Signals     []Signal            `json:"signals,omitempty"`
	Relays      []Relay             `json:"servers,omitempty"`
	Candidate   *CandidateMessage   `json:"candidate,omitempty"`
	Control     *ControlMessage     `json:"control,omitempty"`
	Description *DescriptionMessage `json:"description,omitempty"`
}

func (SignalingMessage) String

func (msg SignalingMessage) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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