Versions in this module Expand all Collapse all v1 v1.2.0 Dec 23, 2018 Changes in this version + var ErrClosed = errors.New("the agent is closed") type Agent + func (a *Agent) Accept(ctx context.Context, remoteUfrag, remotePwd string) (*Conn, 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) type Candidate + IP net.IP + Port int + RelatedAddress *CandidateRelatedAddress + Type CandidateType + func NewCandidateHost(network string, ip net.IP, port int) (*Candidate, error) + func NewCandidateServerReflexive(network string, ip net.IP, port int, relAddr string, relPort int) (*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(typePreference uint16, component uint16) uint16 + 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 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 NetworkType int + const NetworkTypeTCP4 + const NetworkTypeTCP6 + const NetworkTypeUDP4 + const NetworkTypeUDP6 + func (t NetworkType) IsReliable() bool + func (t NetworkType) NetworkShort() string + func (t NetworkType) String() string v1.1.1 Nov 16, 2018 Changes in this version type Candidate + String func() string type CandidateBase + Conn *ipv4.PacketConn type CandidateHost + func (c *CandidateHost) String() string type CandidateSrflx + func (c *CandidateSrflx) String() string v1.1.0 Oct 1, 2018 Changes in this version + const ConnectionStateChecking + const ConnectionStateClosed + const ConnectionStateCompleted + const ConnectionStateConnected + const ConnectionStateDisconnected + const ConnectionStateFailed + const ConnectionStateNew + const HostCandidatePreference + const SrflxCandidatePreference + const Unknown + 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 + LocalCandidates []Candidate + LocalPwd string + LocalUfrag string + func NewAgent(outboundCallback OutboundCallback, notifier func(ConnectionState)) *Agent + func (a *Agent) AddLocalCandidate(c Candidate) + func (a *Agent) AddRemoteCandidate(c Candidate) + func (a *Agent) Close() + func (a *Agent) HandleInbound(buf []byte, local *stun.TransportAddr, remote *net.UDPAddr) + func (a *Agent) SelectedPair() (local *stun.TransportAddr, remote *net.UDPAddr) + func (a *Agent) Start(isControlling bool, remoteUfrag, remotePwd string) error + type Candidate interface + GetBase func() *CandidateBase + type CandidateBase struct + Address string + LastReceived time.Time + LastSent time.Time + Port int + Protocol ProtoType + func (c *CandidateBase) Priority(typePreference uint16, component uint16) uint16 + type CandidateHost struct + func (c *CandidateHost) Address() string + func (c *CandidateHost) GetBase() *CandidateBase + func (c *CandidateHost) Port() int + type CandidatePair struct + type CandidateSrflx struct + RemoteAddress string + RemotePort int + func (c *CandidateSrflx) GetBase() *CandidateBase + type GatheringState int + const GatheringStateComplete + const GatheringStateGathering + const GatheringStateNew + func (t GatheringState) String() string + type OutboundCallback func(raw []byte, local *stun.TransportAddr, remote *net.UDPAddr) + 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 v1.0.0 Jul 4, 2018 Changes in this version + const Checking + const Closed + const Completed + const Connected + const Disconnected + const Failed + const New + func HostInterfaces() (ips []string) + type ConnectionState int + func (c ConnectionState) String() string