handler

package
v0.0.0-...-0b0e567 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package handler implements service debug handler embedded in go-micro services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debug

type Debug struct {
	// must honor the debug handler
	proto.DebugHandler
	// contains filtered or unexported fields
}

Debug is the debug handler for the service.

func NewHandler

func NewHandler(c client.Client) *Debug

NewHandler returns an instance of the Debug Handler.

func (*Debug) GetHealth

func (d *Debug) GetHealth() health.Health

GetHealth returns the health manager for external use. This allows users to register custom health checkers.

func (*Debug) GetWrapperInfo

func (d *Debug) GetWrapperInfo() []map[string]any

GetWrapperInfo returns the wrapper information if a provider is set. Returns nil if no provider has been registered.

func (*Debug) Health

func (d *Debug) Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error

Health returns the health status of the service.

func (*Debug) Log

func (d *Debug) Log(ctx context.Context, req *proto.LogRequest, stream proto.Debug_LogStream) error

func (*Debug) MessageBus

func (d *Debug) MessageBus(ctx context.Context, stream proto.Debug_MessageBusStream) error

func (*Debug) SetAlive

func (d *Debug) SetAlive(alive bool)

SetAlive sets the liveness state of the service.

func (*Debug) SetReady

func (d *Debug) SetReady(ready bool)

SetReady sets the readiness state of the service.

func (*Debug) SetWrapperInfoProvider

func (d *Debug) SetWrapperInfoProvider(provider WrapperInfoProvider)

SetWrapperInfoProvider sets the wrapper info provider function. This allows external packages to register their wrapper introspection capability.

func (*Debug) Stats

func (d *Debug) Stats(ctx context.Context, req *proto.StatsRequest, rsp *proto.StatsResponse) error

func (*Debug) Trace

func (d *Debug) Trace(ctx context.Context, req *proto.TraceRequest, rsp *proto.TraceResponse) error

type WrapperInfoProvider

type WrapperInfoProvider func() []map[string]any

WrapperInfoProvider is a function type that returns wrapper information. This is used to avoid circular imports between debug and wrapper packages.

Source Files

  • debug.go

Jump to

Keyboard shortcuts

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