visor

package
v0.0.0-...-2572d14 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LoggerLevel log level
	AppLoggerLevel config.ValueT[string] = "logger/level"

	// ServicesDefDialDuration default dial duraton to conect a service [optional]
	ServicesDefDialDuration config.ValueT[time.Duration] = "extapi/svc/def-daial-duration"

	// TrDialDuration trace-hub service dial duration [optional]
	TrDialDuration config.ValueT[time.Duration] = "extapi/svc/tracehub/dial-duration"

	// TrAddress service address [mandatory]
	TrAddress config.ValueT[string] = "extapi/svc/tracehub/address"

	// UseCompression enable compression for grpc messages
	UseCompression config.ValueT[bool] = "extapi/svc/tracehub/use-compression"

	// UserAgent
	UserAgent config.ValueT[string] = "useragent"
)

Variables

View Source
var (
	ErrVisorAlreadyStarted = errors.New("visor has already started")
	ErrVisorAlreadyPaused  = errors.New("visor has already paused")
	ErrVisorStopped        = errors.New("visor has stopped")
	ErrVisorRunOrStopped   = errors.New("visor has already run or stopped")
)

Functions

func NewLogger

func NewLogger(l zapcore.Level, jsonMode bool, options ...zap.Option)

func NewTextLoggerWithSink

func NewTextLoggerWithSink(level log.LevelEnabler, sink io.Writer, options ...zap.Option) log.TypeOfLogger

func SetupContext

func SetupContext()

SetupContext setup app ctx

func SetupLogger

func SetupLogger(jsonMode bool) error

SetupLogger setup app logger

func SetupVisorSubject

func SetupVisorSubject()

SetupVisorSubject -

func VisorSubject

func VisorSubject() observer.Subject

VisorSubject -

Types

type Deps

type Deps struct {
	// Adapters
	Client       THClient
	TracePrinter Printer
}

Deps - dependency

type ErrVisor

type ErrVisor struct {
	Err error
}

ErrVisor -

func (ErrVisor) Cause

func (e ErrVisor) Cause() error

Cause -

func (ErrVisor) Error

func (e ErrVisor) Error() string

Error -

type Printer

type Printer interface {
	Print([]model.FetchTraceModel)
}

type THClient

type THClient = thAPI.Client

type THClosableClient

type THClosableClient = thAPI.ClosableClient

THClosableClient is an alias to 'thAPI.ClosableClient'

func NewTHClient

func NewTHClient(ctx context.Context) (*THClosableClient, error)

NewTHClient makes 'trace-hub' API client

type Visor

type Visor interface {
	Run(context.Context, model.TraceScopeModel) error
	Close() error
}

func NewVisor

func NewVisor(d Deps) Visor

type VisorSubjectClosed

type VisorSubjectClosed struct{ observer.EventType }

VisorSubjectClosed -

Directories

Path Synopsis
cmd
visor-ui
cmd
tui

Jump to

Keyboard shortcuts

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