inspect

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 18 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).Register(grpcServer)

A request for another node is forwarded to that node's Inspector, reached as the node reaches its peers (Node.Dial), so one Inspector answers for the whole cluster.

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, Call 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. WithPeers(nil) keeps the server to its own node: a request for another node is then FailedPrecondition.

func WithResolver

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

WithResolver has the server reach other nodes' Inspectors through r and opts rather than the node's own Dial: for Inspectors that peers serve elsewhere than on the server their node links through, or over other credentials. It keeps one connection per node, until Close.

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. It forwards a request for another node to that node's Inspector, which it reaches through node.Dial, unless WithResolver or WithPeers says otherwise.

func (*Server) Call added in v0.1.0

func (*Server) Close

func (s *Server) Close() error

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

func (*Server) Exit

func (*Server) GetNode

func (*Server) GetProcess

func (*Server) ListNames added in v0.4.0

func (*Server) LookupName added in v0.4.0

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