common

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsEventType added in v0.2.0

func AsEventType(s string) string

func Content added in v0.4.0

func Content(s string) string

func DeDotMap added in v0.4.5

func DeDotMap(in map[string]string) map[string]string

func JsonMarshal added in v0.3.10

func JsonMarshal(t interface{}) ([]byte, error)

Types

type Event

type Event struct {
	Time    time.Time              `json:"time"`
	Channel string                 `json:"channel"`
	Type    string                 `json:"type"`
	Data    interface{}            `json:"data"`
	Via     map[string]interface{} `json:"via,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) GetSpanContext added in v0.0.2

func (e *Event) GetSpanContext() sreCommon.TracerSpanContext

func (*Event) JsonBytes added in v0.2.0

func (e *Event) JsonBytes() ([]byte, error)

func (*Event) JsonMap added in v0.2.6

func (e *Event) JsonMap() (map[string]interface{}, error)

func (*Event) JsonObject

func (e *Event) JsonObject() (interface{}, error)

func (*Event) SetLogger added in v0.0.2

func (e *Event) SetLogger(logger sreCommon.Logger)

func (*Event) SetSpanContext added in v0.0.2

func (e *Event) SetSpanContext(context sreCommon.TracerSpanContext)

func (*Event) SetTime added in v0.1.1

func (e *Event) SetTime(time time.Time)

type HttpProcessor added in v0.1.0

type HttpProcessor interface {
	Processor
	HandleHttpRequest(w http.ResponseWriter, r *http.Request) error
}

type Input

type Input interface {
	Start(wg *sync.WaitGroup, outputs *Outputs)
}

type Inputs

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

func NewInputs

func NewInputs() Inputs

func (*Inputs) Add

func (is *Inputs) Add(i Input)

func (*Inputs) Start

func (is *Inputs) Start(wg *sync.WaitGroup, ots *Outputs)

type Observability added in v0.1.0

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

func NewObservability added in v0.1.0

func NewObservability(logs *sre.Logs, traces *sre.Traces, metrics *sre.Metrics, events *sre.Events) *Observability

func (*Observability) Debug added in v0.4.3

func (o *Observability) Debug(obj interface{}, args ...interface{})

func (*Observability) Error added in v0.4.1

func (o *Observability) Error(obj interface{}, args ...interface{})

func (*Observability) Events added in v0.1.0

func (o *Observability) Events() *sre.Events

func (*Observability) Info added in v0.4.1

func (o *Observability) Info(obj interface{}, args ...interface{})

func (*Observability) Logs added in v0.1.0

func (o *Observability) Logs() *sre.Logs

func (*Observability) Metrics added in v0.1.0

func (o *Observability) Metrics() *sre.Metrics

func (*Observability) Traces added in v0.1.0

func (o *Observability) Traces() *sre.Traces

func (*Observability) Warn added in v0.4.1

func (o *Observability) Warn(obj interface{}, args ...interface{})

type Output

type Output interface {
	Send(event *Event)
	Name() string
}

type Outputs

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

func NewOutputs

func NewOutputs(logger sreCommon.Logger) Outputs

func (*Outputs) Add

func (ots *Outputs) Add(o Output)

func (*Outputs) Send

func (ots *Outputs) Send(e *Event)

func (*Outputs) SendForward added in v0.3.6

func (ots *Outputs) SendForward(e *Event, exclude []Output, pattern string)

type Processor added in v0.2.0

type Processor interface {
	EventType() string
	HandleEvent(e *Event) error
}

type Processors added in v0.2.0

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

func NewProcessors added in v0.2.0

func NewProcessors() *Processors

func (*Processors) Add added in v0.2.0

func (ps *Processors) Add(p Processor)

func (*Processors) Find added in v0.2.0

func (ps *Processors) Find(eventType string) Processor

func (*Processors) FindHttpProcessor added in v0.2.0

func (ps *Processors) FindHttpProcessor(eventType string) HttpProcessor

Jump to

Keyboard shortcuts

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