jid

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MatchesNode indicates that left and right operand has same node value.
	MatchesNode = MatchingOptions(1)

	// MatchesDomain indicates that left and right operand has same domain value.
	MatchesDomain = MatchingOptions(2)

	// MatchesResource indicates that left and right operand has same resource value.
	MatchesResource = MatchingOptions(4)

	// MatchesBare indicates that left and right operand has same node and domain value.
	MatchesBare = MatchesNode | MatchesDomain
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JID

type JID struct {
	// contains filtered or unexported fields
}

JID represents an XMPP address (JID). A JID is made up of a node (generally a username), a domain, and a resource. The node and resource are optional; domain is required.

func New

func New(node, domain, resource string, skipStringPrep bool) (*JID, error)

New constructs a JID given a user, domain, and resource. This construction allows the caller to specify if stringprep should be applied or not.

func NewWithString

func NewWithString(str string, skipStringPrep bool) (*JID, error)

NewWithString constructs a JID from it's string representation. This construction allows the caller to specify if stringprep should be applied or not.

func (*JID) Domain

func (j *JID) Domain() string

Domain returns the domain.

func (*JID) IsBare

func (j *JID) IsBare() bool

IsBare returns true if instance is a bare JID.

func (*JID) IsFull

func (j *JID) IsFull() bool

IsFull returns true if instance is a full JID.

func (*JID) IsFullWithServer

func (j *JID) IsFullWithServer() bool

IsFullWithServer returns true if instance is a full server JID.

func (*JID) IsFullWithUser

func (j *JID) IsFullWithUser() bool

IsFullWithUser returns true if instance is a full client JID.

func (*JID) IsServer

func (j *JID) IsServer() bool

IsServer returns true if instance is a server JID.

func (*JID) Matches

func (j *JID) Matches(j2 *JID, options MatchingOptions) bool

Matches returns true if two JID's are equivalent.

func (*JID) Node

func (j *JID) Node() string

Node returns the node, or empty string if this JID does not contain node information.

func (*JID) Resource

func (j *JID) Resource() string

Resource returns the resource, or empty string if this JID does not contain resource information.

func (*JID) String

func (j *JID) String() string

String returns a string representation of the JID.

func (*JID) ToBareJID

func (j *JID) ToBareJID() *JID

ToBareJID returns the JID equivalent of the bare JID, which is the JID with resource information removed.

type MatchingOptions

type MatchingOptions int8

MatchingOptions represents a matching jid mask.

Jump to

Keyboard shortcuts

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