github.com/chenbh/concourse/v6@v6.4.2/worker/runtime/network.go (about)

     1  package runtime
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/containerd/containerd"
     7  	"github.com/opencontainers/runtime-spec/specs-go"
     8  )
     9  
    10  //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . Network
    11  
    12  type Network interface {
    13  	// SetupMounts prepares mounts that might be necessary for proper
    14  	// networking functionality.
    15  	//
    16  	SetupMounts(handle string) (mounts []specs.Mount, err error)
    17  
    18  	// SetupRestrictedNetworks sets up networking rules to prevent
    19  	// container access to specified network ranges
    20  	//
    21  	SetupRestrictedNetworks() (err error)
    22  
    23  	// Add adds a task to the network.
    24  	//
    25  	Add(ctx context.Context, task containerd.Task) (err error)
    26  
    27  	// Removes a task from the network.
    28  	//
    29  	Remove(ctx context.Context, task containerd.Task) (err error)
    30  }