cat

package
v3.12.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cat provides functionality related to the wire format of CAT headers.

Index

Constants

View Source
const (
	NewRelicIDName         = "X-Newrelic-Id"
	NewRelicTxnName        = "X-Newrelic-Transaction"
	NewRelicAppDataName    = "X-Newrelic-App-Data"
	NewRelicSyntheticsName = "X-Newrelic-Synthetics"
)

These header names don't match the spec in terms of their casing, but does match what Go will give us from http.CanonicalHeaderKey(). Besides, HTTP headers are case insensitive anyway. Rejoice!

Variables

This section is empty.

Functions

func GeneratePathHash

func GeneratePathHash(referringPathHash, txnName, appName string) (string, error)

GeneratePathHash generates a path hash given a referring path hash, transaction name, and application name. referringPathHash can be an empty string if there was no referring path hash.

Types

type AppDataHeader

type AppDataHeader struct {
	CrossProcessID        string
	TransactionName       string
	QueueTimeInSeconds    float64
	ResponseTimeInSeconds float64
	ContentLength         int64
	TransactionGUID       string
}

AppDataHeader represents a decoded AppData header.

func (*AppDataHeader) MarshalJSON

func (appData *AppDataHeader) MarshalJSON() ([]byte, error)

MarshalJSON marshalls an AppDataHeader as raw JSON.

func (*AppDataHeader) UnmarshalJSON

func (appData *AppDataHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls an AppDataHeader from raw JSON.

type IDHeader

type IDHeader struct {
	AccountID int
	Blob      string
}

IDHeader represents a decoded cross process ID header (generally encoded as a string in the form ACCOUNT#BLOB).

func NewIDHeader

func NewIDHeader(in []byte) (*IDHeader, error)

NewIDHeader parses the given decoded ID header and creates an IDHeader representing it.

type SyntheticsHeader

type SyntheticsHeader struct {
	Version    int
	AccountID  int
	ResourceID string
	JobID      string
	MonitorID  string
}

SyntheticsHeader represents a decoded Synthetics header.

func (*SyntheticsHeader) UnmarshalJSON

func (s *SyntheticsHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls a SyntheticsHeader from raw JSON.

type TxnDataHeader

type TxnDataHeader struct {
	GUID     string
	TripID   string
	PathHash string
}

TxnDataHeader represents a decoded TxnData header.

func (*TxnDataHeader) MarshalJSON

func (txnData *TxnDataHeader) MarshalJSON() ([]byte, error)

MarshalJSON marshalls a TxnDataHeader as raw JSON.

func (*TxnDataHeader) UnmarshalJSON

func (txnData *TxnDataHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls a TxnDataHeader from raw JSON.

Jump to

Keyboard shortcuts

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