Versions in this module Expand all Collapse all v1 v1.7.0 Feb 26, 2026 Changes in this version + const CoreProtocolVersion + const EnvUnixSocketDir + const EnvUnixSocketGroup + const GRPCServiceName + var ErrChecksumsDoNotMatch = errors.New("checksums did not match") + var ErrGRPCBrokerMuxNotSupported = errors.New(...) + var ErrProcessNotFound = cmdrunner.ErrProcessNotFound + var ErrSecureConfigAndReattach = errors.New("only one of Reattach or SecureConfig can be set") + var ErrSecureConfigNoChecksum = errors.New("no checksum provided") + var ErrSecureConfigNoHash = errors.New("no hash implementation provided") + var Killed uint32 = 0 + func CleanupClients() + func DefaultGRPCServer(opts []grpc.ServerOption) *grpc.Server + func Discover(glob, dir string) ([]string, error) + func Serve(opts *ServeConfig) + func ServeMux(m ServeMuxMap) + func TestConn(t testing.T) (net.Conn, net.Conn) + func TestGRPCConn(t testing.T, register func(*grpc.Server)) (*grpc.ClientConn, *grpc.Server) + func TestPluginGRPCConn(t testing.T, multiplex bool, ps map[string]Plugin) (*GRPCClient, *GRPCServer) + type BasicError struct + Message string + func NewBasicError(err error) *BasicError + func (e *BasicError) Error() string + type Client struct + func NewClient(config *ClientConfig) (c *Client) + func (c *Client) Client() (ClientProtocol, error) + func (c *Client) Exited() bool + func (c *Client) ID() string + func (c *Client) Kill() + func (c *Client) NegotiatedVersion() int + func (c *Client) Protocol() Protocol + func (c *Client) ReattachConfig() *ReattachConfig + func (c *Client) Start() (addr net.Addr, err error) + type ClientConfig struct + AllowedProtocols []Protocol + AutoMTLS bool + Cmd *exec.Cmd + GRPCBrokerMultiplex bool + GRPCDialOptions []grpc.DialOption + Logger hclog.Logger + Managed bool + MaxPort uint + MinPort uint + PluginLogBufferSize int + Plugins PluginSet + Reattach *ReattachConfig + RunnerFunc func(l hclog.Logger, cmd *exec.Cmd, tmpDir string) (runner.Runner, error) + SecureConfig *SecureConfig + SkipHostEnv bool + SkipLogParsing bool + StartTimeout time.Duration + Stderr io.Writer + SyncStderr io.Writer + SyncStdout io.Writer + TLSConfig *tls.Config + UnixSocketConfig *UnixSocketConfig + VersionedPlugins map[int]PluginSet + type ClientProtocol interface + Dispense func(string) (any, error) + Ping func() error + type GRPCBroker struct + func (b *GRPCBroker) Accept(id uint32) (net.Listener, error) + func (b *GRPCBroker) AcceptAndServe(id uint32, newGRPCServer func([]grpc.ServerOption) *grpc.Server) + func (b *GRPCBroker) Close() error + func (b *GRPCBroker) Dial(id uint32) (conn *grpc.ClientConn, err error) + func (b *GRPCBroker) DialWithOptions(id uint32, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) + func (m *GRPCBroker) NextId() uint32 + func (m *GRPCBroker) Run() + type GRPCClient struct + Conn *grpc.ClientConn + Plugins map[string]Plugin + func (c *GRPCClient) Close() error + func (c *GRPCClient) Dispense(name string) (any, error) + func (c *GRPCClient) Ping() error + type GRPCServer struct + DoneCh chan struct{} + Plugins map[string]Plugin + Server func([]grpc.ServerOption) *grpc.Server + Stderr io.Reader + Stdout io.Reader + TLS *tls.Config + func (s *GRPCServer) Config() string + func (s *GRPCServer) GracefulStop() + func (s *GRPCServer) Init() error + func (s *GRPCServer) Serve(lis net.Listener) + func (s *GRPCServer) Stop() + type GRPCServerConfig struct + StderrAddr string + StdoutAddr string + type HandshakeConfig struct + MagicCookieKey string + MagicCookieValue string + ProtocolVersion uint + type Plugin interface + GRPCClient func(context.Context, *GRPCBroker, *grpc.ClientConn) (any, error) + GRPCServer func(*GRPCBroker, *grpc.Server) error + type PluginSet map[string]Plugin + type Protocol string + const ProtocolGRPC + const ProtocolInvalid + type ReattachConfig struct + Addr net.Addr + Pid int + Protocol Protocol + ProtocolVersion int + ReattachFunc runner.ReattachFunc + Test bool + type SecureConfig struct + Checksum []byte + Hash hash.Hash + func (s *SecureConfig) Check(filePath string) (bool, error) + type ServeConfig struct + GRPCServer func([]grpc.ServerOption) *grpc.Server + Logger hclog.Logger + Plugins PluginSet + TLSProvider func() (*tls.Config, error) + Test *ServeTestConfig + VersionedPlugins map[int]PluginSet + type ServeMuxMap map[string]*ServeConfig + type ServeTestConfig struct + CloseCh chan<- struct{} + Context context.Context + ReattachConfigCh chan<- *ReattachConfig + SyncStdio bool + type ServerProtocol interface + Config func() string + Init func() error + Serve func(net.Listener) + type UnixSocketConfig struct + Group string + TempDir string