Documentation ¶
Index ¶
- type C2S
- type InOutStream
- type InStream
- type MockC2S
- func (m *MockC2S) Context() context.Context
- func (m *MockC2S) Disconnect(_ context.Context, err error)
- func (m *MockC2S) Domain() string
- func (m *MockC2S) ID() string
- func (m *MockC2S) IsAuthenticated() bool
- func (m *MockC2S) IsDisconnected() bool
- func (m *MockC2S) IsSecured() bool
- func (m *MockC2S) JID() *jid.JID
- func (m *MockC2S) Presence() *xmpp.Presence
- func (m *MockC2S) ReceiveElement() xmpp.XElement
- func (m *MockC2S) Resource() string
- func (m *MockC2S) SendElement(_ context.Context, elem xmpp.XElement)
- func (m *MockC2S) SetAuthenticated(authenticated bool)
- func (m *MockC2S) SetJID(jid *jid.JID)
- func (m *MockC2S) SetPresence(presence *xmpp.Presence)
- func (m *MockC2S) SetSecured(secured bool)
- func (m *MockC2S) SetValue(key, value interface{})
- func (m *MockC2S) Username() string
- func (m *MockC2S) Value(key interface{}) interface{}
- func (m *MockC2S) WaitDisconnection() error
- type S2SIn
- type S2SOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type C2S ¶
type C2S interface { InOutStream Context() context.Context SetValue(key, value interface{}) Value(key interface{}) interface{} Username() string Domain() string Resource() string JID() *jid.JID IsSecured() bool IsAuthenticated() bool Presence() *xmpp.Presence }
C2S represents a client-to-server bi-direction XMPP stream.
type InOutStream ¶
InOutStream represents a generic bi-direction stream.
type MockC2S ¶
type MockC2S struct {
// contains filtered or unexported fields
}
MockC2S represents a mocked c2s stream.
func NewMockC2S ¶
NewMockC2S returns a new mocked stream instance.
func (*MockC2S) Disconnect ¶
Disconnect disconnects mocked stream.
func (*MockC2S) IsAuthenticated ¶
IsAuthenticated returns whether or not a mocked stream has successfully authenticated.
func (*MockC2S) IsDisconnected ¶
IsDisconnected returns whether or not a mocked stream has been disconnected.
func (*MockC2S) ReceiveElement ¶
ReceiveElement waits until a new XML element is sent to the mocked stream and return it.
func (*MockC2S) SendElement ¶
SendElement sends the given XML element.
func (*MockC2S) SetAuthenticated ¶
SetAuthenticated sets whether or not a mocked stream has successfully authenticated.
func (*MockC2S) SetPresence ¶
SetPresence sets the mocked stream last received presence element.
func (*MockC2S) SetSecured ¶
SetSecured sets whether or not a mocked stream has been secured.
func (*MockC2S) SetValue ¶
func (m *MockC2S) SetValue(key, value interface{})
SetValue sets the mocked stream key/value pair.
func (*MockC2S) Value ¶
func (m *MockC2S) Value(key interface{}) interface{}
Value returns current stream key's value.
func (*MockC2S) WaitDisconnection ¶
WaitDisconnection waits untail the mocked stream disconnects.
type S2SIn ¶
type S2SIn interface { InStream }
S2SIn represents an incoming server-to-server one-direction XMPP stream.
type S2SOut ¶
type S2SOut interface { InOutStream }
S2SOut represents an outgoing server-to-server one-dirction XMPP stream.