Documentation
¶
Overview ¶
Package core abstracts out the inner workings of CCSMP and provides a few key entities used by various other services. For example, it contains SolClientTransport which wraps the session and context, as well as SolClientPublisher which wraps the session and provides hooks for callbacks. SolClient structs are not responsible for state tracking.
Index ¶
- func GetVersion() (version, buildTime, variant string)
- func SetLogLevel(level logging.LogLevel)
- func SetNativeLogLevel(level logging.LogLevel)
- func SetVersion(defaultVersion string)
- func ToNativeError(err ErrorInfo, args ...string) error
- type AcknowledgementHandler
- type Acknowledgements
- type ErrorInfo
- type Event
- type EventHandler
- type EventInfo
- type Events
- type FlowEventInfo
- type MessageID
- type Metrics
- type NextGenMetric
- type PersistentEventCallback
- type PersistentReceiver
- type Publishable
- type Publisher
- type Receivable
- type Receiver
- type RxCallback
- type SendTask
- type SessionEventInfo
- type SubscriptionCorrelationID
- type SubscriptionEvent
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToNativeError ¶
ToNativeError wrapps the ErrorInfo in a solace.NativeError with a prefix string if provided.
Types ¶
type AcknowledgementHandler ¶
AcknowledgementHandler defined
type Acknowledgements ¶
type Acknowledgements interface { // Registers a callback for correlation AddAcknowledgementHandler(ackHandler AcknowledgementHandler) (uint64, func() (messageId uint64, correlationTag []byte)) // Deregisters the callback for correlation RemoveAcknowledgementHandler(pubID uint64) }
Acknowledgements interface
type ErrorInfo ¶
type ErrorInfo = *ccsmp.SolClientErrorInfoWrapper
ErrorInfo reexports *ccsmp.SolClientErrorInfoWrapper. In all cases, core.ErrorInfo should be used instead of *ccsmp.SolClientErrorInfoWrapper
type Event ¶
type Event int
Event type defined
const ( // SolClientEventUp represents ccsmp.SolClientSessionEventUpNotice in sessionEventMapping SolClientEventUp Event = iota // SolClientEventDown represents SolClientSessionEventDownError in sessionEventMapping SolClientEventDown // SolClientEventCanSend represents ccsmp.SolClientSessionEventCanSend in sessionEventMapping SolClientEventCanSend // SolClientEventAcknowledgement represents ccsmp.SolClientSessionEventAcknowledgement in sessionEventMapping SolClientEventAcknowledgement // SolClientEventRejected represents ccsmp.SolClientSessionEventRejectedMsgError in sessionEventMapping SolClientEventRejected // SolClientEventReconnect represents ccsmp.SolClientSessionEventReconnectedNotice in sessionEventMapping SolClientEventReconnect // SolClientEventReconnectAttempt represents ccsmp.SolClientSessionEventReconnectingNotice in sessionEventMapping SolClientEventReconnectAttempt // SolClientSubscriptionOk represents ccsmp.SolClientSessionEventSubscriptionOk in sessionEventMapping SolClientSubscriptionOk // SolClientSubscriptionError represents ccsmp.SolClientSessionEventSubscriptionError in sessionEventMapping SolClientSubscriptionError )
type Events ¶
type Events interface { AddEventHandler(sessionEvent Event, responseCode EventHandler) uint RemoveEventHandler(id uint) }
Events interface defined
type Metrics ¶
type Metrics interface { GetStat(metric metrics.Metric) uint64 IncrementMetric(metric NextGenMetric, amount uint64) ResetStats() }
Metrics interface
type NextGenMetric ¶
type NextGenMetric int
NextGenMetric structure
const ( // MetricReceivedMessagesTerminationDiscarded initialized MetricReceivedMessagesTerminationDiscarded NextGenMetric = iota // MetricReceivedMessagesBackpressureDiscarded initialized MetricReceivedMessagesBackpressureDiscarded NextGenMetric = iota // MetricPublishMessagesTerminationDiscarded initialized MetricPublishMessagesTerminationDiscarded NextGenMetric = iota // MetricPublishMessagesBackpressureDiscarded initialized MetricPublishMessagesBackpressureDiscarded NextGenMetric = iota // MetricInternalDiscardNotifications initialized MetricInternalDiscardNotifications NextGenMetric = iota )
type PersistentEventCallback ¶
type PersistentEventCallback func(event ccsmp.SolClientFlowEvent, eventInfo FlowEventInfo)
PersistentEventCallback type defined
type PersistentReceiver ¶
type PersistentReceiver interface { // Destroy destroys the flow Destroy(freeMemory bool) ErrorInfo // Start will start the receiption of messages // Persistent Receivers are started by default after creation Start() ErrorInfo // Stop will stop the reception of messages Stop() ErrorInfo // Subscribe will add a subscription to the persistent receiver Subscribe(topic string) (SubscriptionCorrelationID, <-chan SubscriptionEvent, ErrorInfo) // Unsubscribe will remove the subscription from the persistent receiver Unsubscribe(topic string) (SubscriptionCorrelationID, <-chan SubscriptionEvent, ErrorInfo) // Ack will acknowledge the given message Ack(msgID MessageID) ErrorInfo // Destionation returns the destination if retrievable, or an error if one occurred Destination() (destination string, durable bool, errorInfo ErrorInfo) }
PersistentReceiver interface
type Publisher ¶
type Publisher interface { // Publish pulishes a message in the form of a SolClientPublishable. Returns any error info from underlying send. Publish(message Publishable) ErrorInfo // Events returns SolClientEvents Events() Events // AwaitWritable awaits a writable message. Throws an error if interrupted for termination AwaitWritable(terminateSignal chan struct{}) error // TaskQueue gets the task queue that can be used to push tasks // TaskQueue may be a 0 length queue such that each task is transactioned, ie. no tasks sit in flux TaskQueue() chan SendTask // checks if the internal publisher is running IsRunning() bool // Increments a core metric IncrementMetric(metric NextGenMetric, amount uint64) // Acknowledgements returns the acknowledgement handler Acknowledgements() Acknowledgements }
Publisher interface
type Receiver ¶
type Receiver interface { // checks if the internal receiver is running IsRunning() bool // Events returns SolClientEvents Events() Events // Register an RX callback, returns a correlation pointer used when adding and removing subscriptions RegisterRXCallback(msgCallback RxCallback) uintptr // Remove the callback allowing GC to cleanup the function registered UnregisterRXCallback(ptr uintptr) // Add a subscription to the given correlation pointer Subscribe(topic string, ptr uintptr) (SubscriptionCorrelationID, <-chan SubscriptionEvent, ErrorInfo) // Remove a subscription from the given correlation pointer Unsubscribe(topic string, ptr uintptr) (SubscriptionCorrelationID, <-chan SubscriptionEvent, ErrorInfo) // Clears the subscription correlation with the given ID ClearSubscriptionCorrelation(id SubscriptionCorrelationID) // ProvisionEndpoint will provision an endpoint ProvisionEndpoint(queueName string, isExclusive bool) ErrorInfo // EndpointUnsubscribe will call endpoint unsubscribe on the endpoint EndpointUnsubscribe(queueName string, topic string) (SubscriptionCorrelationID, <-chan SubscriptionEvent, ErrorInfo) // Increments receiver metrics IncrementMetric(metric NextGenMetric, amount uint64) // Creates a new persistent receiver with the given callback NewPersistentReceiver(properties []string, callback RxCallback, eventCallback PersistentEventCallback) (PersistentReceiver, ErrorInfo) }
Receiver interface
type SessionEventInfo ¶
SessionEventInfo interface defined
type SubscriptionCorrelationID ¶
type SubscriptionCorrelationID = uintptr
SubscriptionCorrelationID defined
type SubscriptionEvent ¶
type SubscriptionEvent interface { GetID() SubscriptionCorrelationID GetError() error }
SubscriptionEvent is the event passed to a channel on completion of a subscription