pubsub

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message[T any] struct {
	// contains filtered or unexported fields
}

func (*Message[T]) Ack

func (m *Message[T]) Ack()

func (*Message[T]) Body

func (m *Message[T]) Body() T

func (*Message[T]) CreatedAt

func (m *Message[T]) CreatedAt() time.Time

func (*Message[T]) ID

func (m *Message[T]) ID() string

func (*Message[T]) LastViewedAt

func (m *Message[T]) LastViewedAt() time.Time

func (*Message[T]) Nack

func (m *Message[T]) Nack()

type Subscription

type Subscription[T any] struct {
	// contains filtered or unexported fields
}

func (*Subscription[T]) Name

func (s *Subscription[T]) Name() string

func (*Subscription[T]) Subscribe

func (s *Subscription[T]) Subscribe(ctx context.Context, consumer function.Consumer[*Message[T]])

func (*Subscription[T]) Topic

func (s *Subscription[T]) Topic() *Topic[T]

type Topic

type Topic[T any] struct {
	// contains filtered or unexported fields
}

func NewTopic

func NewTopic[T any](name string) *Topic[T]

func (*Topic[T]) Name

func (t *Topic[T]) Name() string

func (*Topic[T]) NewSubscription

func (t *Topic[T]) NewSubscription(name string, concurrency int, interval time.Duration, ttl time.Duration) *Subscription[T]

func (*Topic[T]) Publish

func (t *Topic[T]) Publish(body T)

func (*Topic[T]) Subscriptions

func (t *Topic[T]) Subscriptions() map[string]*Subscription[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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