pubsubutil

package module
v0.0.0-...-d63fec9 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UseProtobuf = false
)

Functions

func GetTopic

func GetTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)

func Start

func Start(ctx context.Context, c PubsubConfig) error

func Subscribe

func Subscribe(ctx context.Context, topicID string, handler func(context.Context, *pubsub.Message)) error

Types

type PubsubConfig

type PubsubConfig struct {
	Host      string           `yaml:"host"`
	Port      string           `yaml:"port"`
	Projectid string           `yaml:"projectid"`
	Emulator  bool             `yaml:"emulator"`
	Topics    map[string]Topic `yaml:"topics"`
}

func ParsePubsubConfig

func ParsePubsubConfig(config map[string]string) (PubsubConfig, error)

type Topic

type Topic struct {
	Name                   string `yaml:"name"`
	Subscription           string `yaml:"subscription"`
	CreateTopic            bool   `yaml:"createTopic"`
	CreateSubscription     bool   `yaml:"createSubscription"`
	Concurrency            int    `yaml:"concurrency"`
	MaxOutstandingMessages int    `yaml:"maxOutstandingMessages"`
}

Jump to

Keyboard shortcuts

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