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 ¶
- func Event(e *inspectv1.Event) grpcproc.Event
- func NodeInfo(n *inspectv1.NodeInfo) grpcproc.NodeInfo
- func ProcessInfo(p *inspectv1.ProcessInfo) grpcproc.ProcessInfo
- type Option
- type PeerFunc
- type Server
- func (s *Server) Close() error
- func (s *Server) Exit(ctx context.Context, req *inspectv1.ExitRequest) (*inspectv1.ExitResponse, error)
- func (s *Server) GetNode(ctx context.Context, req *inspectv1.GetNodeRequest) (*inspectv1.GetNodeResponse, error)
- func (s *Server) GetProcess(ctx context.Context, req *inspectv1.GetProcessRequest) (*inspectv1.GetProcessResponse, error)
- func (s *Server) ListProcesses(ctx context.Context, req *inspectv1.ListProcessesRequest) (*inspectv1.ListProcessesResponse, error)
- func (s *Server) Register(r grpc.ServiceRegistrar)
- func (s *Server) Send(ctx context.Context, req *inspectv1.SendRequest) (*inspectv1.SendResponse, error)
- func (s *Server) SetLogLevel(ctx context.Context, req *inspectv1.SetLogLevelRequest) (*inspectv1.SetLogLevelResponse, error)
- func (s *Server) Watch(req *inspectv1.WatchRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 Server ¶
type Server struct {
inspectv1.UnimplementedInspectorServer
// contains filtered or unexported fields
}
Server implements grpcproc.inspect.v1.Inspector for one node.
func (*Server) Close ¶
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 (s *Server) Exit(ctx context.Context, req *inspectv1.ExitRequest) (*inspectv1.ExitResponse, error)
func (*Server) GetNode ¶
func (s *Server) GetNode(ctx context.Context, req *inspectv1.GetNodeRequest) (*inspectv1.GetNodeResponse, error)
func (*Server) GetProcess ¶
func (s *Server) GetProcess(ctx context.Context, req *inspectv1.GetProcessRequest) (*inspectv1.GetProcessResponse, error)
func (*Server) ListProcesses ¶
func (s *Server) ListProcesses(ctx context.Context, req *inspectv1.ListProcessesRequest) (*inspectv1.ListProcessesResponse, error)
func (*Server) Register ¶
func (s *Server) Register(r grpc.ServiceRegistrar)
Register mounts the Inspector on r.
func (*Server) Send ¶
func (s *Server) Send(ctx context.Context, req *inspectv1.SendRequest) (*inspectv1.SendResponse, error)
func (*Server) SetLogLevel ¶
func (s *Server) SetLogLevel(ctx context.Context, req *inspectv1.SetLogLevelRequest) (*inspectv1.SetLogLevelResponse, error)
func (*Server) Watch ¶
func (s *Server) Watch(req *inspectv1.WatchRequest, stream grpc.ServerStreamingServer[inspectv1.WatchResponse]) error