forked from ckousik/go-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoint.go
30 lines (25 loc) · 952 Bytes
/
endpoint.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package introspection
// 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 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
}
// Session represents an introspection session.
type Session struct {
// RemoteAddr is the remote address of the session.
RemoteAddr string
}