events

package
v0.14.10 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const SessionEventTypeCircuitUpdated = "circuitUpdated"
View Source
const SessionEventTypeCreated = "created"
View Source
const SessionEventTypeDeleted = "deleted"

Variables

This section is empty.

Functions

func AddSessionEventHandler

func AddSessionEventHandler(handler network.SessionEventHandler)

func AddTraceEventHandler

func AddTraceEventHandler(handler trace.EventHandler)

func NewFileEventLogger added in v0.14.9

func NewFileEventLogger(formatterFactory LoggingHandlerFactory, stdout bool, config map[interface{}]interface{}) (interface{}, error)

func RegisterEventHandler added in v0.14.9

func RegisterEventHandler(id interface{}, config map[interface{}]interface{})

func RegisterEventHandlerType added in v0.14.9

func RegisterEventHandlerType(eventHandlerType string, factory EventHandlerFactory)

func RegisterEventType added in v0.14.9

func RegisterEventType(eventType string, registrationHandler registrationHandler)

func RemoveSessionEventHandler

func RemoveSessionEventHandler(handler network.SessionEventHandler)

func RemoveTraceEventHandler

func RemoveTraceEventHandler(handler trace.EventHandler)

func WireEventHandlers added in v0.14.9

func WireEventHandlers() error

* Example configuration: events:

jsonLogger:
  subscriptions:
    - type: metrics
      sourceFilter: .*
      metricFilter: .*xgress.*tx*.m1_rate
    - type: fabric.sessions
      include:
        - created
    - type: edge.sessions
      include:
        - created
  handler:
    type: file
    format: json
    path: /tmp/ziti-events.log

Types

type BaseFormatter added in v0.14.9

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

func (*BaseFormatter) AcceptLoggingEvent added in v0.14.9

func (f *BaseFormatter) AcceptLoggingEvent(event LoggingEvent)

func (*BaseFormatter) Run added in v0.14.9

func (f *BaseFormatter) Run()

type EventHandlerFactory added in v0.14.9

type EventHandlerFactory interface {
	NewEventHandler(config map[interface{}]interface{}) (interface{}, error)
}

type FileEventLoggerFactory added in v0.14.9

type FileEventLoggerFactory struct{}

func (FileEventLoggerFactory) NewEventHandler added in v0.14.9

func (FileEventLoggerFactory) NewEventHandler(config map[interface{}]interface{}) (interface{}, error)

type JsonFabricSessionEvent added in v0.14.9

type JsonFabricSessionEvent SessionEvent

func (*JsonFabricSessionEvent) WriteTo added in v0.14.9

func (event *JsonFabricSessionEvent) WriteTo(output io.WriteCloser) error

type JsonFormatter added in v0.14.9

type JsonFormatter struct {
	BaseFormatter
}

func NewJsonFormatter added in v0.14.9

func NewJsonFormatter(queueDepth int, output io.WriteCloser) *JsonFormatter

func (*JsonFormatter) AcceptMetricsEvent added in v0.14.9

func (formatter *JsonFormatter) AcceptMetricsEvent(event *MetricsEvent)

func (*JsonFormatter) AcceptSessionEvent added in v0.14.9

func (formatter *JsonFormatter) AcceptSessionEvent(event *SessionEvent)

func (*JsonFormatter) AcceptUsageEvent added in v0.14.9

func (formatter *JsonFormatter) AcceptUsageEvent(event *UsageEvent)

type JsonMetricsEvent added in v0.14.9

type JsonMetricsEvent MetricsEvent

func (*JsonMetricsEvent) WriteTo added in v0.14.9

func (event *JsonMetricsEvent) WriteTo(output io.WriteCloser) error

type JsonUsageEvent added in v0.14.9

type JsonUsageEvent UsageEvent

func (*JsonUsageEvent) WriteTo added in v0.14.9

func (event *JsonUsageEvent) WriteTo(output io.WriteCloser) error

type LoggingEvent added in v0.14.9

type LoggingEvent interface {
	WriteTo(output io.WriteCloser) error
}

type LoggingHandlerFactory added in v0.14.9

type LoggingHandlerFactory interface {
	NewLoggingHandler(format string, buffer int, out io.WriteCloser) (interface{}, error)
}

type MetricsEvent added in v0.14.9

type MetricsEvent struct {
	Namespace    string
	SourceId     string
	Timestamp    *timestamp.Timestamp
	Tags         map[string]string
	IntMetrics   map[string]int64
	FloatMetrics map[string]float64
	MetricGroup  map[string]string
}

type MetricsEventHandler added in v0.14.9

type MetricsEventHandler interface {
	AcceptMetricsEvent(event *MetricsEvent)
}

type PlainTextFabricSessionEvent added in v0.14.9

type PlainTextFabricSessionEvent SessionEvent

func (*PlainTextFabricSessionEvent) WriteTo added in v0.14.9

func (event *PlainTextFabricSessionEvent) WriteTo(output io.WriteCloser) error

type PlainTextFormatter added in v0.14.9

type PlainTextFormatter struct {
	BaseFormatter
}

func NewPlainTextFormatter added in v0.14.9

func NewPlainTextFormatter(queueDepth int, output io.WriteCloser) *PlainTextFormatter

func (*PlainTextFormatter) AcceptMetricsEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptMetricsEvent(event *MetricsEvent)

func (*PlainTextFormatter) AcceptSessionEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptSessionEvent(event *SessionEvent)

func (*PlainTextFormatter) AcceptUsageEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptUsageEvent(event *UsageEvent)

type PlainTextMetricsEvent added in v0.14.9

type PlainTextMetricsEvent MetricsEvent

func (*PlainTextMetricsEvent) WriteTo added in v0.14.9

func (event *PlainTextMetricsEvent) WriteTo(output io.WriteCloser) error

type PlainTextUsageEvent added in v0.14.9

type PlainTextUsageEvent UsageEvent

func (*PlainTextUsageEvent) WriteTo added in v0.14.9

func (event *PlainTextUsageEvent) WriteTo(output io.WriteCloser) error

type SessionEvent added in v0.14.9

type SessionEvent struct {
	Namespace string `json:"namespace"`
	EventType string `json:"event_type"`
	SessionId string `json:"session_id"`
	ClientId  string `json:"client_id"`
	ServiceId string `json:"service_id"`
	Circuit   string `json:"circuit"`
}

Will work for all fabric session event types

func (*SessionEvent) String added in v0.14.9

func (event *SessionEvent) String() string

type SessionEventAdapter added in v0.14.9

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

func (*SessionEventAdapter) CircuitUpdated added in v0.14.9

func (adapter *SessionEventAdapter) CircuitUpdated(sessionId *identity.TokenId, circuit *network.Circuit)

func (*SessionEventAdapter) SessionCreated added in v0.14.9

func (adapter *SessionEventAdapter) SessionCreated(sessionId *identity.TokenId, clientId *identity.TokenId, serviceId string, circuit *network.Circuit)

func (*SessionEventAdapter) SessionDeleted added in v0.14.9

func (adapter *SessionEventAdapter) SessionDeleted(sessionId *identity.TokenId, clientId *identity.TokenId)

type SessionEventHandler added in v0.14.9

type SessionEventHandler interface {
	AcceptSessionEvent(event *SessionEvent)
}

type StdOutLoggerFactory added in v0.14.9

type StdOutLoggerFactory struct{}

func (StdOutLoggerFactory) NewEventHandler added in v0.14.9

func (StdOutLoggerFactory) NewEventHandler(config map[interface{}]interface{}) (interface{}, error)

type UsageEvent added in v0.14.9

type UsageEvent struct {
	Namespace        string `json:"namespace"`
	EventType        string `json:"event_type"`
	SourceId         string `json:"source_id"`
	SessionId        string `json:"session_id"`
	Usage            uint64 `json:"usage"`
	IntervalStartUTC int64  `json:"interval_start_utc"`
	IntervalLength   uint64 `json:"interval_length"`
}

func (*UsageEvent) String added in v0.14.9

func (event *UsageEvent) String() string

type UsageEventHandler added in v0.14.9

type UsageEventHandler interface {
	AcceptUsageEvent(event *UsageEvent)
}

Jump to

Keyboard shortcuts

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