newrelic

package
v1.1.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func NewPublisherRegister

func NewPublisherRegister() ginats.PublisherMiddleware

NewPublisherRegister returns a new newrelic plugin with default options.

func NewPublisherRegisterWithConfigPath

func NewPublisherRegisterWithConfigPath(path string) (ginats.PublisherMiddleware, error)

NewPublisherRegisterWithConfigPath returns a new newrelic plugin with options from config path.

func NewPublisherRegisterWithOptions

func NewPublisherRegisterWithOptions(options *Options) ginats.PublisherMiddleware

NewPublisherRegisterWithOptions returns a new newrelic plugin with options.

func Register

func Register(msgHandler nats.MsgHandler) nats.MsgHandler

Register registers a new newrelic plugin for nats subscriber.

Types

type Options

type Options struct {
	Enabled bool
}

Options newrelic plugin for nats options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals options based a given key path.

type Publisher

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

Publisher represents newrelic plugin for nats publisher.

func (*Publisher) After

func (p *Publisher) After(ctx context.Context) error

After finishes the newrelic.MessageProducerSegment (https://godoc.org/github.com/newrelic/go-agent#MessageProducerSegment) on context.

func (*Publisher) Before

func (p *Publisher) Before(ctx context.Context, conn *nats.Conn, msg *nats.Msg) (context.Context, error)

Before creates and starts a newrelic.MessageProducerSegment (https://godoc.org/github.com/newrelic/go-agent#MessageProducerSegment) for NATS publishers.

type Subscriber

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

Subscriber represents newrelic plugin for nats subscriber.

func NewSubscriber

func NewSubscriber() *Subscriber

NewSubscriber returns a new newrelic plugin with default options.

func NewSubscriberWithConfigPath

func NewSubscriberWithConfigPath(path string) (*Subscriber, error)

NewSubscriberWithConfigPath returns a new newrelic plugin with options from config path.

func NewSubscriberWithOptions

func NewSubscriberWithOptions(options *Options) *Subscriber

NewSubscriberWithOptions returns a new newrelic plugin with options.

func (*Subscriber) Register

func (p *Subscriber) Register(msgHandler nats.MsgHandler) nats.MsgHandler

Register registers this newrelic plugin for nats subscriber.

Jump to

Keyboard shortcuts

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