xpubsub

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigInterface

type ConfigInterface interface {
	Host() string
	Project() string
}

type Interface

type Interface interface {
	GetTopics(ctx context.Context) ([]TopicItem, error)
	GetSubscriptionsByTopic(ctx context.Context, topic string) ([]SubscriptionItem, error)
	CreateTopic(ctx context.Context, id string) error
	GetSubscriptions(ctx context.Context) ([]SubscriptionItem, error)
	CreateSubscription(ctx context.Context, id string, topicID string) error
	DeleteTopic(ctx context.Context, id string) error
	DeleteSubscription(ctx context.Context, id string) error
	CreateTopicAndSubscriptions(ctx context.Context, topicSpecs []TopicSpec) error
}

type PubSubClient

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

func NewPubSubClient

func NewPubSubClient(config ConfigInterface) *PubSubClient

func (*PubSubClient) CreateSubscription

func (c *PubSubClient) CreateSubscription(ctx context.Context, subscription string, topic string) error

func (*PubSubClient) CreateTopic

func (c *PubSubClient) CreateTopic(ctx context.Context, topic string) error

func (*PubSubClient) CreateTopicAndSubscriptions

func (c *PubSubClient) CreateTopicAndSubscriptions(ctx context.Context, topicSpecs []TopicSpec) error

func (*PubSubClient) DeleteSubscription

func (c *PubSubClient) DeleteSubscription(ctx context.Context, subsName string) error

func (*PubSubClient) DeleteTopic

func (c *PubSubClient) DeleteTopic(ctx context.Context, topic string) error

func (*PubSubClient) GetSubscriptions

func (c *PubSubClient) GetSubscriptions(ctx context.Context) ([]SubscriptionItem, error)

func (*PubSubClient) GetSubscriptionsByTopic

func (c *PubSubClient) GetSubscriptionsByTopic(ctx context.Context, topic string) ([]SubscriptionItem, error)

func (*PubSubClient) GetTopics

func (c *PubSubClient) GetTopics(ctx context.Context) ([]TopicItem, error)

func (*PubSubClient) PublishMessage

func (c *PubSubClient) PublishMessage(ctx context.Context, topic string, msg string) error

type SubscriptionItem

type SubscriptionItem struct {
	ID      string
	Name    string
	TopicID string
}

type TopicItem

type TopicItem struct {
	ID   string
	Name string
}

type TopicSpec

type TopicSpec struct {
	Name          string
	Subscriptions []string
}

func LoadTopic

func LoadTopic(file string) ([]TopicSpec, error)

type TopicWrapper

type TopicWrapper struct {
	Topics map[string][]string `yaml:"topics"`
}

Jump to

Keyboard shortcuts

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