Versions in this module Expand all Collapse all v0 v0.2.0 Apr 1, 2019 Changes in this version type AgentConfig + LoggerFactory logging.LoggerFactory v0.1.1 Mar 26, 2019 Changes in this version + var ErrNoCandidatePairs = errors.New("no candidate pairs available") v0.1.0 Mar 25, 2019 Changes in this version + const ComponentRTCP + const ComponentRTP + const ConnectionStateChecking + const ConnectionStateClosed + const ConnectionStateCompleted + const ConnectionStateConnected + const ConnectionStateDisconnected + const ConnectionStateFailed + const ConnectionStateNew + const Unknown + var ErrClosed = errors.New("the agent is closed") + var ErrHost = errors.New("invalid hostname") + var ErrInvalidQuery = errors.New("invalid query") + var ErrPort = errors.New("invalid port") + var ErrProtoType = errors.New("invalid transport protocol type") + var ErrSTUNQuery = errors.New("queries not supported in stun address") + var ErrSchemeType = errors.New("unknown scheme type") + var ErrUnknownType = errors.New("Unknown") + type Agent struct + func NewAgent(config *AgentConfig) (*Agent, error) + func (a *Agent) Accept(ctx context.Context, remoteUfrag, remotePwd string) (*Conn, error) + func (a *Agent) AddRemoteCandidate(c *Candidate) error + func (a *Agent) Close() error + func (a *Agent) Dial(ctx context.Context, remoteUfrag, remotePwd string) (*Conn, error) + func (a *Agent) GetLocalCandidates() ([]*Candidate, error) + func (a *Agent) GetLocalUserCredentials() (frag string, pwd string) + func (a *Agent) OnConnectionStateChange(f func(ConnectionState)) error + func (a *Agent) OnSelectedCandidatePairChange(f func(*Candidate, *Candidate)) error + type AgentConfig struct + ConnectionTimeout *time.Duration + KeepaliveInterval *time.Duration + NetworkTypes []NetworkType + PortMax uint16 + PortMin uint16 + Urls []*URL + type Candidate struct + Component uint16 + IP net.IP + LocalPreference uint16 + Port int + RelatedAddress *CandidateRelatedAddress + Type CandidateType + func NewCandidateHost(network string, ip net.IP, port int, component uint16) (*Candidate, error) + func NewCandidatePeerReflexive(network string, ip net.IP, port int, component uint16, relAddr string, ...) (*Candidate, error) + func NewCandidateRelay(network string, ip net.IP, port int, component uint16, relAddr string, ...) (*Candidate, error) + func NewCandidateServerReflexive(network string, ip net.IP, port int, component uint16, relAddr string, ...) (*Candidate, error) + func (c *Candidate) Equal(other *Candidate) bool + func (c *Candidate) LastReceived() time.Time + func (c *Candidate) LastSent() time.Time + func (c *Candidate) Priority() uint16 + func (c *Candidate) String() string + type CandidateRelatedAddress struct + Address string + Port int + func (c *CandidateRelatedAddress) Equal(other *CandidateRelatedAddress) bool + func (c *CandidateRelatedAddress) String() string + type CandidateType byte + const CandidateTypeHost + const CandidateTypePeerReflexive + const CandidateTypeRelay + const CandidateTypeServerReflexive + func (c CandidateType) Preference() uint16 + func (c CandidateType) String() string + type Conn struct + func (c *Conn) Close() error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) Read(p []byte) (int, error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetDeadline(t time.Time) error + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Write(p []byte) (int, error) + type ConnectionState int + func (c ConnectionState) String() string + type GatheringState int + const GatheringStateComplete + const GatheringStateGathering + const GatheringStateNew + func (t GatheringState) String() string + type NetworkType int + const NetworkTypeTCP4 + const NetworkTypeTCP6 + const NetworkTypeUDP4 + const NetworkTypeUDP6 + func (t NetworkType) IsIPv4() bool + func (t NetworkType) IsIPv6() bool + func (t NetworkType) IsReliable() bool + func (t NetworkType) NetworkShort() string + func (t NetworkType) String() string + type ProtoType int + const ProtoTypeTCP + const ProtoTypeUDP + func NewProtoType(raw string) ProtoType + func (t ProtoType) String() string + type SchemeType int + const SchemeTypeSTUN + const SchemeTypeSTUNS + const SchemeTypeTURN + const SchemeTypeTURNS + func NewSchemeType(raw string) SchemeType + func (t SchemeType) String() string + type URL struct + Host string + Port int + Proto ProtoType + Scheme SchemeType + func ParseURL(raw string) (*URL, error) + func (u URL) IsSecure() bool + func (u URL) String() string