summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/internal/channelz/socket.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/grpc/internal/channelz/socket.go')
-rw-r--r--vendor/google.golang.org/grpc/internal/channelz/socket.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/google.golang.org/grpc/internal/channelz/socket.go b/vendor/google.golang.org/grpc/internal/channelz/socket.go
index fa64834b2..90103847c 100644
--- a/vendor/google.golang.org/grpc/internal/channelz/socket.go
+++ b/vendor/google.golang.org/grpc/internal/channelz/socket.go
@@ -70,13 +70,18 @@ type EphemeralSocketMetrics struct {
RemoteFlowControlWindow int64
}
+// SocketType represents the type of socket.
type SocketType string
+// SocketType can be one of these.
const (
SocketTypeNormal = "NormalSocket"
SocketTypeListen = "ListenSocket"
)
+// Socket represents a socket within channelz which includes socket
+// metrics and data related to socket activity and provides methods
+// for managing and interacting with sockets.
type Socket struct {
Entity
SocketType SocketType
@@ -100,6 +105,8 @@ type Socket struct {
Security credentials.ChannelzSecurityValue
}
+// String returns a string representation of the Socket, including its parent
+// entity, socket type, and ID.
func (ls *Socket) String() string {
return fmt.Sprintf("%s %s #%d", ls.Parent, ls.SocketType, ls.ID)
}