publisher

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 16 Imported by: 2

Documentation

Overview

package publisher provides a common interface for publish operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublisherSchemes added in v0.0.12

func PublisherSchemes() []string

func RegisterGoCloudPublishers added in v0.0.12

func RegisterGoCloudPublishers(ctx context.Context) error

RegisterGoCloudPublishers will explicitly register all the schemes associated with the `GoCloudPublisher` interface.

func RegisterNullPublishers added in v0.0.12

func RegisterNullPublishers(ctx context.Context) error

func RegisterPublisher

func RegisterPublisher(ctx context.Context, scheme string, f PublisherInitializeFunc) error

func RegisterRedisPublishers added in v0.0.12

func RegisterRedisPublishers(ctx context.Context) error

func RegisterStdoutPublishers added in v0.0.12

func RegisterStdoutPublishers(ctx context.Context) error

Types

type ChannelPublisher

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

func (*ChannelPublisher) Close

func (pub *ChannelPublisher) Close() error

func (*ChannelPublisher) Publish

func (pub *ChannelPublisher) Publish(ctx context.Context, msg string) error

type GoCloudPublisher

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

func (*GoCloudPublisher) Close

func (pub *GoCloudPublisher) Close() error

func (*GoCloudPublisher) Publish

func (pub *GoCloudPublisher) Publish(ctx context.Context, str_msg string) error

type NullPublisher added in v0.0.9

type NullPublisher struct {
	Publisher
}

func (*NullPublisher) Close added in v0.0.9

func (pub *NullPublisher) Close() error

func (*NullPublisher) Publish added in v0.0.9

func (pub *NullPublisher) Publish(ctx context.Context, msg string) error

type Publisher

type Publisher interface {
	Publish(context.Context, string) error
	Close() error
}

func NewChannelPublisherWithChannel

func NewChannelPublisherWithChannel(ctx context.Context, ch chan string) (Publisher, error)

func NewGoCloudPublisher

func NewGoCloudPublisher(ctx context.Context, uri string) (Publisher, error)

func NewNullPublisher added in v0.0.9

func NewNullPublisher(ctx context.Context, uri string) (Publisher, error)

func NewPublisher

func NewPublisher(ctx context.Context, uri string) (Publisher, error)

func NewRedisPublisher

func NewRedisPublisher(ctx context.Context, uri string) (Publisher, error)

func NewStdoutPublisher added in v0.0.6

func NewStdoutPublisher(ctx context.Context, uri string) (Publisher, error)

type PublisherInitializeFunc

type PublisherInitializeFunc func(ctx context.Context, uri string) (Publisher, error)

type RedisPublisher

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

func (*RedisPublisher) Close

func (p *RedisPublisher) Close() error

func (*RedisPublisher) Publish

func (p *RedisPublisher) Publish(ctx context.Context, msg string) error

type StdoutPublisher added in v0.0.6

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

func (*StdoutPublisher) Close added in v0.0.6

func (pub *StdoutPublisher) Close() error

func (*StdoutPublisher) Publish added in v0.0.6

func (pub *StdoutPublisher) Publish(ctx context.Context, msg string) error

Jump to

Keyboard shortcuts

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