server

package
v1.1.1035 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NatsConfig string

NatsConfig holds the current configuration of the SHAR Telemetry Server

Functions

func SetupMetrics added in v1.1.785

func SetupMetrics(ctx context.Context, cfg *config.Settings, serviceName string) (*sdkmetric.MeterProvider, error)

SetupMetrics initialises metrics

Types

type AbandonOpError

type AbandonOpError struct {
	Err error
}

AbandonOpError signifies an operation should trigger abandoning the active task.

func (*AbandonOpError) Error

func (w *AbandonOpError) Error() string

type Exporter added in v1.0.331

type Exporter interface {
	ExportSpans(ctx context.Context, spans []tracesdk.ReadOnlySpan) error
}

Exporter represents an interface to the span exporter

type MockExporter added in v1.1.754

type MockExporter struct {
	mock.Mock
}

MockExporter is an autogenerated mock type for the Exporter type

func NewMockExporter added in v1.1.754

func NewMockExporter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockExporter

NewMockExporter creates a new instance of MockExporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockExporter) EXPECT added in v1.1.754

func (_m *MockExporter) EXPECT() *MockExporter_Expecter

func (*MockExporter) ExportSpans added in v1.1.754

func (_m *MockExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error

ExportSpans provides a mock function with given fields: ctx, spans

type MockExporter_Expecter added in v1.1.754

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

func (*MockExporter_Expecter) ExportSpans added in v1.1.754

func (_e *MockExporter_Expecter) ExportSpans(ctx interface{}, spans interface{}) *MockExporter_ExportSpans_Call

ExportSpans is a helper method to define mock.On call

  • ctx context.Context
  • spans []trace.ReadOnlySpan

type MockExporter_ExportSpans_Call added in v1.1.754

type MockExporter_ExportSpans_Call struct {
	*mock.Call
}

MockExporter_ExportSpans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExportSpans'

func (*MockExporter_ExportSpans_Call) Return added in v1.1.754

func (*MockExporter_ExportSpans_Call) Run added in v1.1.754

func (*MockExporter_ExportSpans_Call) RunAndReturn added in v1.1.754

type Server

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

Server is the shar server type responsible for hosting the telemetry server.

func New

func New(ctx context.Context, nc *nats.Conn, js jetstream.JetStream, storageType jetstream.StorageType, exp Exporter) *Server

New creates a new telemetry server.

func (*Server) Listen

func (s *Server) Listen() error

Listen starts the telemetry server.

Jump to

Keyboard shortcuts

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