service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APMZProxy

type APMZProxy struct {
	Printer format.Printer
	apmz.TelemetryClient
}

APMZProxy will proxy calls to the APMZ client or print if running locally

func (APMZProxy) Track

func (apmzp APMZProxy) Track(item apmz.Telemetry)

Track will either send to the client or print depending if the proxy printer is set

type APMer

type APMer interface {
	Track(telemetry apmz.Telemetry)
	Channel() apmz.TelemetryChannel
}

APMer provides the behaviors needed to send events to Azure Application Insights

type CommandServicer

type CommandServicer interface {
	GetAPMer() (APMer, error)
	GetPrinter() format.Printer
	GetKey() string
}

CommandServicer provides all functionality needed for command execution

type Event

type Event struct {
	Type string         `json:"type,omitempty"`
	Item apmz.Telemetry `json:"item,omitempty"`
}

Event is a typed batch event

func (*Event) UnmarshalJSON

func (evt *Event) UnmarshalJSON(b []byte) error

UnmarshalJSON takes json bytes and turns them into an event

type EventType

type EventType string

EventType represents the enumeration of all the event types the Batch command understands

const (
	// Trace is a "traces" event type in Application Insights
	Trace EventType = "trace"
	// Metric is a "customMetrics" event type in Application Insights
	Metric EventType = "metric"
)

type Registry

type Registry struct {
	APMerFactory   func() (APMer, error)
	PrinterFactory func() format.Printer
	APIKeyFactory  func() string
	// contains filtered or unexported fields
}

Registry holds the factories and services needed for command execution

func (*Registry) GetAPMer

func (r *Registry) GetAPMer() (APMer, error)

GetAPMer returns an instance of an Azure Application Insights client

func (*Registry) GetKey added in v0.2.1

func (r *Registry) GetKey() string

GetKey will return the api-key for application insights

func (*Registry) GetPrinter

func (r *Registry) GetPrinter() format.Printer

GetPrinter will return a printer for printing command output

Jump to

Keyboard shortcuts

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