gtm

package
v0.1.29 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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 Publisher

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

func NewPublisher

func NewPublisher(l *zap.Logger, host 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 PublisherMarshalMessageFunc added in v0.1.28

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

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

type PublisherOption

type PublisherOption func(*Publisher)

func PublisherWithClient

func PublisherWithClient(v *http.Client) PublisherOption

func PublisherWithMarshalMessageFunc

func PublisherWithMarshalMessageFunc(v PublisherMarshalMessageFunc) PublisherOption

func PublisherWithPath added in v0.1.29

func PublisherWithPath(v string) PublisherOption

Jump to

Keyboard shortcuts

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