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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTopicDoesNotExist = errors.New("pubsub topic doesn't exist")
	ErrEmptySession      = errors.New("pubsub session can't be nil")
)

Functions

This section is empty.

Types

type Publisher

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

Publisher holds the kinesis connection and the stream name.

func NewPublisher

func NewPublisher(ctx context.Context, cfg SessionConfig) (*Publisher, error, func() error)

NewPublisher creates a new kinesis connection.

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, topicID string, data []byte) error

Publish publish the data to the correct stream. nolint: exhaustivestruct

type SessionConfig

type SessionConfig struct {
	ProjectID string        `split_words:"true"`
	Timeout   time.Duration `default:"5s"`
}

Jump to

Keyboard shortcuts

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