c2smodel

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info interface {
	// String returns string value associated to k key.
	String(k string) string

	// Bool returns bool value associated to k key.
	Bool(k string) bool

	// Int returns int value associated to k key.
	Int(k string) int

	// Float returns float64 value associated to k key.
	Float(k string) float64

	// Map returns map info set copy.
	Map() map[string]string
}

Info represents C2S immutable info set.

type InfoMap added in v0.56.0

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

InfoMap represents a mutable c2s info set.

func NewInfoMap added in v0.56.0

func NewInfoMap() *InfoMap

NewInfoMap returns an empty mutable info set.

func NewInfoMapFromInfo added in v0.56.0

func NewInfoMapFromInfo(inf Info) *InfoMap

NewInfoMapFromInfo returns a mutable info set derived from a read-only info map.

func NewInfoMapFromMap added in v0.56.0

func NewInfoMapFromMap(m map[string]string) *InfoMap

NewInfoMapFromMap returns a mutable info set of derived from m.

func (*InfoMap) Bool added in v0.56.0

func (im *InfoMap) Bool(k string) bool

func (*InfoMap) Float added in v0.56.0

func (im *InfoMap) Float(k string) float64

func (*InfoMap) Int added in v0.56.0

func (im *InfoMap) Int(k string) int

func (*InfoMap) Map added in v0.56.0

func (im *InfoMap) Map() map[string]string

func (*InfoMap) ReadOnly added in v0.56.0

func (im *InfoMap) ReadOnly() Info

ReadOnly returns a read-only info map reference.

func (*InfoMap) SetBool added in v0.56.0

func (im *InfoMap) SetBool(k string, v bool)

SetBool sets a boolean info value.

func (*InfoMap) SetFloat added in v0.56.0

func (im *InfoMap) SetFloat(k string, v float64)

SetFloat sets a float info value.

func (*InfoMap) SetInt added in v0.56.0

func (im *InfoMap) SetInt(k string, v int)

SetInt sets an integer info value.

func (*InfoMap) SetString added in v0.56.0

func (im *InfoMap) SetString(k, v string)

SetString sets a string info value.

func (*InfoMap) String added in v0.56.0

func (im *InfoMap) String(k string) string

type ResourceDesc added in v0.56.0

type ResourceDesc interface {
	// InstanceID specifies the instance identifier that registered the resource.
	InstanceID() string

	// JID returns the resource associated JID value.
	JID() *jid.JID

	// Presence returns the resource associated presence stanza.
	Presence() *stravaganza.Presence

	// Info returns resource registered info.
	Info() Info

	// IsAvailable returns presence available value.
	IsAvailable() bool

	// Priority returns resource presence priority.
	Priority() int8
}

ResourceDesc represents read-only a resource description.

func NewResourceDesc added in v0.56.0

func NewResourceDesc(instanceID string, jd *jid.JID, pr *stravaganza.Presence, inf Info) ResourceDesc

NewResourceDesc initializes and returns a read-only resource description.

Jump to

Keyboard shortcuts

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