gtm

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderUUID   = "Message-Uuid"
	ProviderName = "gtm"
)

Variables

View Source
var (
	ErrErrorResponse   = errors.New("server responded with error status")
	ErrPublisherClosed = errors.New("publisher is closed")
)

Functions

This section is empty.

Types

type MarshalMessageFunc

type MarshalMessageFunc func(url string, msg *message.Message) (*http.Request, error)

MarshalMessageFunc transforms the message into a HTTP request to be sent to the specified url.

type Publisher

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

func NewPublisher

func NewPublisher(url string, opts ...PublisherOption) *Publisher

func (*Publisher) Client

func (p *Publisher) Client() *http.Client

func (*Publisher) Close

func (p *Publisher) Close() error

func (*Publisher) Publish

func (p *Publisher) Publish(topic string, messages ...*message.Message) error

type PublisherOption

type PublisherOption func(*Publisher)

func PublisherWithClient

func PublisherWithClient(v *http.Client) PublisherOption

func PublisherWithMarshalMessageFunc

func PublisherWithMarshalMessageFunc(v MarshalMessageFunc) PublisherOption

Jump to

Keyboard shortcuts

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