github.com/MetalBlockchain/metalgo@v1.11.9/snow/validators/connector.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package validators
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/MetalBlockchain/metalgo/ids"
    10  	"github.com/MetalBlockchain/metalgo/version"
    11  )
    12  
    13  // Connector represents a handler that is called when a connection is marked as
    14  // connected or disconnected
    15  type Connector interface {
    16  	Connected(
    17  		ctx context.Context,
    18  		nodeID ids.NodeID,
    19  		nodeVersion *version.Application,
    20  	) error
    21  	Disconnected(ctx context.Context, nodeID ids.NodeID) error
    22  }