pubsub

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubscriptionDoesNotExists = errors.New("subscription does not exists")
)

Functions

This section is empty.

Types

type SessionConfig

type SessionConfig struct {
	ProjectID    string `split_words:"true"`
	Subscription string `split_words:"true"`
}

type Subscriber

type Subscriber struct {
	SubscriptionID string
	// contains filtered or unexported fields
}

Subscriber is the kinesis subscriber.

func NewSubscriber

func NewSubscriber(ctx context.Context, cfg SessionConfig) (*Subscriber, error, func() error)

NewSubscriber creates a new instance of Subscriber.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, fn func(ctx context.Context, payload []byte, headers map[string][]string) error) error

Subscribe subscribes to the kinesis stream. nolint: exhaustivestruct

Jump to

Keyboard shortcuts

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