...

Package resource

import "solace.dev/go/messaging/pkg/solace/resource"
Overview
Index

Overview ▾

Package resource contains types and factory functions for various broker resources such as topics and queues.

type Destination

Destination represents a message destination on a broker. Some examples of destinations include queues and topics. Destination implementations can be retrieved by the various helper functions, such as TopicOf, QueueDurableExclusive, and TopicSubscriptionOf.

type Destination interface {
    // GetName retrieves the name of the destination
    GetName() string
}

type Queue

Queue represents a queue used for guaranteed messaging receivers.

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

func QueueDurableExclusive

func QueueDurableExclusive(queueName string) *Queue

QueueDurableExclusive creates a new durable, exclusive queue with the specified name.

func QueueDurableNonExclusive

func QueueDurableNonExclusive(queueName string) *Queue

QueueDurableNonExclusive creates a durable, non-exclusive queue with the specified name.

func QueueNonDurableExclusive

func QueueNonDurableExclusive(queueName string) *Queue

QueueNonDurableExclusive creates an exclusive, non-durable queue with the specified name.

func QueueNonDurableExclusiveAnonymous

func QueueNonDurableExclusiveAnonymous() *Queue

QueueNonDurableExclusiveAnonymous creates an anonymous, exclusive, and non-durable queue.

func (*Queue) GetName

func (q *Queue) GetName() string

GetName returns the name of the queue. Implements the Destination interface.

func (*Queue) IsDurable

func (q *Queue) IsDurable() bool

IsDurable determines if the Queue is durable. Durable queues are privisioned objects on the broker that have a lifespan that is independent of any one client session.

func (*Queue) IsExclusivelyAccessible

func (q *Queue) IsExclusivelyAccessible() bool

IsExclusivelyAccessible determines if Queue supports exclusive or shared-access mode. Returns true if the Queue can serve only one consumer at any one time, false if the Queue can serve multiple consumers with each consumer serviced in a round-robin fashion.

func (*Queue) String

func (q *Queue) String() string

type ShareName

ShareName is an interface for identifiers that are associated with a shared subscription. See https://docs.solace.com/PubSub-Basics/Direct-Messages.htm#Shared in the Solace documentation.

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

func ShareNameOf

func ShareNameOf(name string) *ShareName

ShareNameOf returns a new share name with the provided name. Valid share names are not empty and do not contain special characters '>' or '*'. Returns a new ShareName with the given string.

func (*ShareName) GetName

func (sn *ShareName) GetName() string

GetName returns the share name. Implements the Destination interface.

func (*ShareName) String

func (sn *ShareName) String() string

String implements fmt.Stringer

type Subscription

Subscription represents the valid subscriptions that can be specified to receivers. Valid subscriptions include *resource.TopicSubscription.

type Subscription interface {
    Destination
    // GetSubscriptionType will return the type of the subscription as a string
    GetSubscriptionType() string
}

type Topic

Topic is an implementation of destination representing a topic that can be published to.

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

func TopicOf

func TopicOf(expression string) *Topic

TopicOf creates a new topic with the specified name. Topic name must not be empty.

func (*Topic) GetName

func (t *Topic) GetName() string

GetName returns the name of the topic. Implements the Destination interface.

func (*Topic) String

func (t *Topic) String() string

String implements fmt.Stringer

type TopicSubscription

TopicSubscription is a subscription to a topic often used for receivers.

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

func TopicSubscriptionOf

func TopicSubscriptionOf(topic string) *TopicSubscription

TopicSubscriptionOf creates a TopicSubscription of the specified topic string.

func (*TopicSubscription) GetName

func (t *TopicSubscription) GetName() string

GetName returns the topic subscription expression. Implements the Destination interface.

func (*TopicSubscription) GetSubscriptionType

func (t *TopicSubscription) GetSubscriptionType() string

GetSubscriptionType returns the type of the topic subscription as a string

func (*TopicSubscription) String

func (t *TopicSubscription) String() string

String implements fmt.Stringer