jid

package
v0.10.2-0...-4baa321 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 9 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

	// MatchesFull indicates that left and right operand has same node, domain and resource value.
	MatchesFull = MatchesNode | MatchesDomain | MatchesResource
)

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 NewFromBytes

func NewFromBytes(buf *bytes.Buffer) (*JID, error)

NewFromBytes constructs a JID from it's gob binary representation.

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) FromBytes

func (j *JID) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a JID entity from it's gob binary representation.

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) bool

Matches tells whether or not j2 matches j.

func (*JID) MatchesWithOptions

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

MatchesWithOptions tells whether two jids are equivalent based on matching options.

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.

func (*JID) ToBytes

func (j *JID) ToBytes(buf *bytes.Buffer) error

ToBytes converts a JID entity to it's gob binary representation.

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