Documentation
¶
Overview ¶
Package grpc contains the functionality for the gRPC server for communicating with the nginx agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStatusInvalidConnection = status.Error(codes.Unauthenticated, "invalid connection")
Functions ¶
This section is empty.
Types ¶
type AgentConnectionsTracker ¶
type AgentConnectionsTracker struct {
// contains filtered or unexported fields
}
AgentConnectionsTracker keeps track of all connections between the control plane and nginx agents.
func (*AgentConnectionsTracker) GetConnection ¶
func (c *AgentConnectionsTracker) GetConnection(key string) Connection
GetConnection returns the requested connection.
func (*AgentConnectionsTracker) RemoveConnection ¶
func (c *AgentConnectionsTracker) RemoveConnection(key string)
RemoveConnection removes a connection from the tracking map.
func (*AgentConnectionsTracker) SetInstanceID ¶
func (c *AgentConnectionsTracker) SetInstanceID(key, id string)
SetInstanceID sets the nginx instanceID for a connection.
func (*AgentConnectionsTracker) Track ¶
func (c *AgentConnectionsTracker) Track(key string, conn Connection)
Track adds a connection to the tracking map.
type Connection ¶
type Connection struct {
PodName string
InstanceID string
Parent types.NamespacedName
}
Connection contains the data about a single nginx agent connection.
func (*Connection) Ready ¶
func (c *Connection) Ready() bool
Ready returns if the connection is ready to be used. In other words, agent has registered itself and an nginx instance with the control plane.
type ConnectionsTracker ¶
type ConnectionsTracker interface {
Track(key string, conn Connection)
GetConnection(key string) Connection
SetInstanceID(key, id string)
RemoveConnection(key string)
}
ConnectionsTracker defines an interface to track all connections between the control plane and nginx agents.
func NewConnectionsTracker ¶
func NewConnectionsTracker() ConnectionsTracker
NewConnectionsTracker returns a new AgentConnectionsTracker instance.
type Interceptor ¶
type Interceptor interface {
Stream(logr.Logger) grpc.StreamServerInterceptor
Unary(logr.Logger) grpc.UnaryServerInterceptor
}
Interceptor provides hooks to intercept the execution of an RPC on the server.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package context contains the functions for storing extra information in the gRPC context.
|
Package context contains the functions for storing extra information in the gRPC context. |
|
Package filewatcher contains the functions to watch for TLS file updates for the gRPC server.
|
Package filewatcher contains the functions to watch for TLS file updates for the gRPC server. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
Package interceptor contains the middleware for intercepting an RPC call.
|
Package interceptor contains the middleware for intercepting an RPC call. |
|
Package messenger provides a wrapper around a gRPC stream with the nginx agent.
|
Package messenger provides a wrapper around a gRPC stream with the nginx agent. |
|
messengerfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |