pubsub

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 10

Documentation

Overview

Package pubsub defines version 1 implementation of pubsub

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() pubsub.PubSub

New creates empty publisher or subscriber

func NewPubSub

func NewPubSub(endPointURI *types.URI, resource string) pubsub.PubSub

NewPubSub create new publisher or subscriber

Types

type API

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

API ... api methods for publisher subscriber

func GetAPIInstance

func GetAPIInstance(storeFilePath string) *API

GetAPIInstance get event instance

func (*API) CreatePublisher

func (p *API) CreatePublisher(pub pubsub.PubSub) (pubsub.PubSub, error)

CreatePublisher create a publisher data and store it a file and cache

func (*API) CreateSubscription

func (p *API) CreateSubscription(sub pubsub.PubSub) (pubsub.PubSub, error)

CreateSubscription create a subscription and store it in a file and cache

func (*API) DeleteAllPublishers

func (p *API) DeleteAllPublishers() error

DeleteAllPublishers delete all the publisher information the store and cache.

func (*API) DeleteAllSubscriptions

func (p *API) DeleteAllSubscriptions() error

DeleteAllSubscriptions delete all subscription information

func (*API) DeletePublisher

func (p *API) DeletePublisher(publisherID string) error

DeletePublisher delete a publisher by id

func (*API) DeleteSubscription

func (p *API) DeleteSubscription(subscriptionID string) error

DeleteSubscription delete a subscription by id

func (*API) DisableTransport

func (p *API) DisableTransport()

DisableTransport disables usage of amqp

func (*API) EnableTransport

func (p *API) EnableTransport()

EnableTransport enable usage of amqp

func (*API) GetFromPubStore

func (p *API) GetFromPubStore(address string) (pubsub.PubSub, error)

GetFromPubStore get data from publisher store

func (*API) GetFromSubStore

func (p *API) GetFromSubStore(address string) (pubsub.PubSub, error)

GetFromSubStore get data from subscription store

func (*API) GetPublisher

func (p *API) GetPublisher(publisherID string) (pubsub.PubSub, error)

GetPublisher get a publisher by it's id

func (*API) GetPublishers

func (p *API) GetPublishers() map[string]*pubsub.PubSub

GetPublishers get all publishers information

func (*API) GetPublishersFromFile

func (p *API) GetPublishersFromFile() ([]byte, error)

GetPublishersFromFile get publisher data from the file store

func (*API) GetSubscription

func (p *API) GetSubscription(subscriptionID string) (pubsub.PubSub, error)

GetSubscription get a subscription by it's id

func (*API) GetSubscriptions

func (p *API) GetSubscriptions() map[string]*pubsub.PubSub

GetSubscriptions get all subscription inforamtions

func (*API) GetSubscriptionsFromFile

func (p *API) GetSubscriptionsFromFile() ([]byte, error)

GetSubscriptionsFromFile get subscriptions data from the file store

func (*API) HasPublisher

func (p *API) HasPublisher(address string) (pubsub.PubSub, bool)

HasPublisher check if the publisher is already exists in the store/cache

func (*API) HasSubscription

func (p *API) HasSubscription(address string) (pubsub.PubSub, bool)

HasSubscription check if the subscription is already exists in the store/cache

func (*API) HasTransportEnabled

func (p *API) HasTransportEnabled() bool

HasTransportEnabled flag to indicate if amqp is enabled

func (*API) ReloadStore

func (p *API) ReloadStore()

ReloadStore reload store if there is any change or refresh is required

Jump to

Keyboard shortcuts

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