Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisconnectUnauthorized ¶
func DisconnectUnauthorized(ctx context.Context, dm *DownstreamManager, connected, authorized []string) error
DisconnectUnauthorized calls disconnects for all ids which are present in the connected but not in the authorized slice of key ids.
func NewTrackingListener ¶
func NewTrackingListener(ctx context.Context, l net.Listener, m *DownstreamManager) (net.Listener, error)
NewTrackingListener returns a listener which adds all connections made through it to the provided DownstreamManager. The net.Conn returned by Accept is only tracked if it is a *tls.Conn and was created by the nodeenrollment library.
Types ¶
type DownstreamManager ¶
type DownstreamManager struct {
// contains filtered or unexported fields
}
DownstreamManager associates downstream worker key identifiers with the connections to a specific server. It is safe to access DownstreamManager concurrently.
func NewDownstreamManager ¶
func NewDownstreamManager() *DownstreamManager
func (*DownstreamManager) Connected ¶
func (m *DownstreamManager) Connected() []string
Connected returns a slice of worker key identifiers for all workers that are currently being tracked by this downstream manager.
func (*DownstreamManager) Disconnect ¶
func (m *DownstreamManager) Disconnect(id string)
Disconnect closes all connections associated with the provided worker key identifier.