Documentation ¶
Overview ¶
Package introspection is EXPERIMENTAL. It is subject to heavy change, and it WILL change. For now, it is the simplest implementation to power the proof-of-concept of the libp2p introspection framework.
Package introspect contains the abstract skeleton of the introspection system of go-libp2p, and holds the introspection data schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint interface { // Start starts the introspection endpoint. It must only be called once, and // once the server is started, subsequent calls made without first calling // Close will error. Start() error // Close stops the introspection endpoint. Calls to Close on an already // closed endpoint (or an unstarted endpoint) must noop. Close() error // ListenAddrs returns the listen addresses of this endpoint. ListenAddrs() []string // Sessions returns the ongoing sessions of this endpoint. Sessions() []*Session }
Endpoint is the interface to be implemented by introspection endpoints.
An introspection endpoint makes introspection data accessible to external consumers, over, for example, WebSockets, or TCP, or libp2p itself.
Experimental.
type Introspector ¶
type Introspector interface { io.Closer // FetchRuntime returns the runtime information of the system. FetchRuntime() (*pb.Runtime, error) // FetchFullState returns the full state cross-cut of the running system. FetchFullState() (*pb.State, error) // EventChan returns the channel where all eventbus events are dumped, // decorated with their corresponding event metadata, ready to send over // the wire. EventChan() <-chan *pb.Event // EventMetadata returns the metadata of all events known to the // Introspector. EventMetadata() []*pb.EventType }
Introspector is the interface to be satisfied by components that are capable of spelunking the state of the system, and representing in accordance with the introspection schema.
It's very rare to build a custom implementation of this interface; it exists mostly for mocking. In most cases, you'll end up using the default introspector.
Introspector implementations are usually injected in introspection endpoints to serve the data to clients, but they can also be used separately for embedding or testing.
Experimental.