apex

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler implements a log.Handler used for shipping logs to Axiom.

func New

func New(baseURL, accessToken, datasetName string, options ...Option) (*Handler, error)

New creates a new Handler configured to talk to the specified Axiom deployment and authenticating with the given access token. An ingest token is sufficient enough. The logs will be ingested into the specified dataset. Additional options can be supplied to configure the Handler. A Handler needs to be closed properly to make sure all logs are sent by calling Close().

func NewCloud

func NewCloud(accessToken, orgID, datasetName string, options ...Option) (*Handler, error)

NewCloud is like New() but configures the Handler to talk to Axiom Cloud.

func NewWithClient

func NewWithClient(client *axiom.Client, datasetName string, options ...Option) (*Handler, error)

NewWithClient behaves like New() but utilizes an already configured axiom.Client to talk to a deployment.

func (*Handler) Close

func (h *Handler) Close()

Close the handler and make sure all events are flushed. Closing the handler renders it unusable for further use.

func (*Handler) HandleLog

func (h *Handler) HandleLog(entry *log.Entry) error

HandleLog implements log.Handler.

func (*Handler) Options

func (h *Handler) Options(options ...Option) error

Options applies Options to the Handler.

type Option

type Option func(*Handler) error

An Option modifies the behaviour of the Axiom handler.

func IngestOptions

func IngestOptions(opts axiom.IngestOptions) Option

IngestOptions specifies the ingestion options to use for ingesting the logs.

Jump to

Keyboard shortcuts

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