inspect

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 16 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package inspect serves grpcproc.inspect.v1.Inspector: a node's processes, links and events over gRPC, for tools and for people. It is optional — register it next to the node on the same server, behind whatever interceptors guard the application's other services.

node.Register(grpcServer)
inspect.New(node, inspect.WithResolver(resolver, dialOptions...)).Register(grpcServer)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Event

func Event(e *inspectv1.Event) grpcproc.Event

Event converts a wire Event back to grpcproc's.

func NodeInfo

func NodeInfo(n *inspectv1.NodeInfo) grpcproc.NodeInfo

NodeInfo converts a wire NodeInfo back to grpcproc's.

func ProcessInfo

func ProcessInfo(p *inspectv1.ProcessInfo) grpcproc.ProcessInfo

ProcessInfo converts a wire ProcessInfo back to grpcproc's.

Types

type Option

type Option func(*Server)

Option configures a Server.

func ReadOnly

func ReadOnly() Option

ReadOnly refuses SetLogLevel, Send and Exit with PermissionDenied.

func WithPeers

func WithPeers(f PeerFunc) Option

WithPeers is WithResolver for other ways of reaching a node's Inspector. Whichever of the two comes last is used. Close does not release what f holds.

func WithResolver

func WithResolver(r grpcproc.Resolver, opts ...grpc.DialOption) Option

WithResolver lets the server answer for other nodes by forwarding to their Inspector, found with r and dialed with opts: usually the node's own Config.Resolver and Config.DialOptions. It keeps one connection per node, until Close. Without it, or WithPeers, a request for another node is FailedPrecondition.

type PeerFunc

type PeerFunc func(ctx context.Context, node string) (inspectv1.InspectorClient, error)

PeerFunc returns the Inspector of another node, to forward a request to.

type Server

type Server struct {
	inspectv1.UnimplementedInspectorServer
	// contains filtered or unexported fields
}

Server implements grpcproc.inspect.v1.Inspector for one node.

func New

func New(node *grpcproc.Node, opts ...Option) *Server

New returns an Inspector for node.

func (*Server) Close

func (s *Server) Close() error

Close closes the connections WithResolver opened to other nodes. The server keeps answering for its own node; with WithResolver, a request for another node fails from then on (Unavailable, or Canceled if it was already on its way).

func (*Server) Exit

func (*Server) GetNode

func (*Server) GetProcess

func (*Server) Register

func (s *Server) Register(r grpc.ServiceRegistrar)

Register mounts the Inspector on r.

func (*Server) Send

func (*Server) SetLogLevel

Jump to

Keyboard shortcuts

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