Documentation
¶
Index ¶
- func WithAndWithout(peer Any) (WithResource, WithoutResource)
- type Any
- type Bare
- type Domain
- func (j Domain) Host() Domain
- func (j Domain) MaybeWithResource(r Resource) Any
- func (j Domain) NoResource() WithoutResource
- func (j Domain) PotentialResource() Resource
- func (j Domain) PotentialSplit() (WithoutResource, Resource)
- func (j Domain) String() string
- func (j Domain) WithResource(r Resource) WithResource
- type Full
- type Local
- type Resource
- type WithLocal
- type WithResource
- type WithoutResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAndWithout ¶
func WithAndWithout(peer Any) (WithResource, WithoutResource)
Types ¶
type Any ¶
type Any interface { // Host will always return the domain component, since all JIDs have one Host() Domain // String will return the natural string representation of the JID String() string // WithResource will return a new JID containing the resource component specified. If the JID already had a resource, it will be replaced WithResource(Resource) WithResource // MaybeWithResource will act like WithResource, if the argument is anything but a blank resource. // Otherwise it will return itself without a resource MaybeWithResource(Resource) Any // NoResource will ensure that the JID returned doesn't have a resource NoResource() WithoutResource // Potential resource returns the resource if one exists, or the blank resource otherwise PotentialResource() Resource // PotentialSplit will return the result of calling WithoutResource and PotentialResource PotentialSplit() (WithoutResource, Resource) }
Any represents any valid JID, including just a hostname, a bare jid, and a jid with a resource
type Bare ¶
type Bare interface { WithoutResource WithLocal }
Bare represents a JID containing both a local component and a host component, but no resource component. A Bare is an Any
type Domain ¶
type Domain string
func (Domain) MaybeWithResource ¶
MaybeWithResource implements WithoutResource
func (Domain) PotentialResource ¶
PotentialResource implements Any
func (Domain) PotentialSplit ¶
func (j Domain) PotentialSplit() (WithoutResource, Resource)
PotentialSplit implements Any
func (Domain) WithResource ¶
func (j Domain) WithResource(r Resource) WithResource
WithResource implements WithoutResource
type Full ¶
type Full interface { WithResource WithLocal }
Full represents a JID containing a local, host and resource component. A Full is a Bare and an Any
type Local ¶
type Local string
func MaybeLocal ¶
MaybeLocal returns the local part of a JID if it has one, otherwise empty
type WithLocal ¶
type WithLocal interface { // Local returns the local part of the JID Local() Local }
Local represents a JID that has a Local port
type WithResource ¶
type WithResource interface { Any // Resource will return the resource Resource() Resource // Split will return the JID split into the part without resource and the part with resource Split() (WithoutResource, Resource) }
WithResource represents any valid JID that has a resource part
func R ¶
func R(s string) WithResource
R returns a JID with resource. This method will fail if the object doesn't have a resource
type WithoutResource ¶
type WithoutResource interface { Any // contains filtered or unexported methods }
WithoutResource represents any valid JID that does not have a resource part