github.com/cnboonhan/delve@v0.0.0-20230908061759-363f2388c2fb/service/config.go (about)

     1  package service
     2  
     3  import (
     4  	"net"
     5  
     6  	"github.com/go-delve/delve/service/debugger"
     7  )
     8  
     9  // Config provides the configuration to start a Debugger and expose it with a
    10  // service.
    11  //
    12  // Only one of ProcessArgs or AttachPid should be specified. If ProcessArgs is
    13  // provided, a new process will be launched. Otherwise, the debugger will try
    14  // to attach to an existing process with AttachPid.
    15  type Config struct {
    16  	// Debugger configuration object, used to configure the underlying
    17  	// debugger used by the server.
    18  	Debugger debugger.Config
    19  
    20  	// Listener is used to serve requests.
    21  	Listener net.Listener
    22  
    23  	// ProcessArgs are the arguments to launch a new process.
    24  	ProcessArgs []string
    25  
    26  	// AcceptMulti configures the server to accept multiple connection.
    27  	// Note that the server API is not reentrant and clients will have to coordinate.
    28  	AcceptMulti bool
    29  
    30  	// APIVersion selects which version of the API to serve (default: 1).
    31  	APIVersion int
    32  
    33  	// CheckLocalConnUser is true if the debugger should check that local
    34  	// connections come from the same user that started the headless server
    35  	CheckLocalConnUser bool
    36  
    37  	// DisconnectChan will be closed by the server when the client disconnects
    38  	DisconnectChan chan<- struct{}
    39  }