Versions in this module Expand all Collapse all v1 v1.1.7 Apr 1, 2021 Changes in this version + const CoreProtocolVersion + const GRPCServiceName + var ErrChecksumsDoNotMatch = errors.New("checksums did not match") + var ErrProcessNotFound = errors.New("Reattachment process not found") + 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) + 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) 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 + Logger hclog.Logger + Managed bool + MaxPort uint + MinPort uint + Plugins PluginSet + Reattach *ReattachConfig + SecureConfig *SecureConfig + StartTimeout time.Duration + Stderr io.Writer + SyncStderr io.Writer + SyncStdout io.Writer + TLSConfig *tls.Config + VersionedPlugins map[int]PluginSet + type ClientProtocol interface + Dispense func(string) (interface{}, error) + Ping func() error + type GRPCBroker struct + func (b *GRPCBroker) Accept(id uint32) (net.Listener, error) + func (b *GRPCBroker) AcceptAndServe(id uint32, s func([]grpc.ServerOption) *grpc.Server) + func (b *GRPCBroker) Close() error + func (b *GRPCBroker) Dial(id uint32) (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) (interface{}, error) + func (c *GRPCClient) Ping() error + type GRPCPlugin interface + GRPCClient func(context.Context, *GRPCBroker, *grpc.ClientConn) (interface{}, error) + GRPCServer func(*GRPCBroker, *grpc.Server) 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 MuxBroker struct + func (m *MuxBroker) Accept(id uint32) (net.Conn, error) + func (m *MuxBroker) AcceptAndServe(id uint32, v interface{}) + func (m *MuxBroker) Close() error + func (m *MuxBroker) Dial(id uint32) (net.Conn, error) + func (m *MuxBroker) NextId() uint32 + func (m *MuxBroker) Run() + type NetRPCUnsupportedPlugin struct + func (p NetRPCUnsupportedPlugin) Client(*MuxBroker, *rpc.Client) (interface{}, error) + func (p NetRPCUnsupportedPlugin) Server(*MuxBroker) (interface{}, error) + type Plugin interface + Client func(*MuxBroker, *rpc.Client) (interface{}, error) + Server func(*MuxBroker) (interface{}, error) + type PluginSet map[string]Plugin + type Protocol string + const ProtocolGRPC + const ProtocolInvalid + const ProtocolNetRPC + type RPCClient struct + func NewRPCClient(conn io.ReadWriteCloser, plugins map[string]Plugin) (*RPCClient, error) + func (c *RPCClient) Close() error + func (c *RPCClient) Dispense(name string) (interface{}, error) + func (c *RPCClient) Ping() error + func (c *RPCClient) SyncStreams(stdout io.Writer, stderr io.Writer) error + type RPCServer struct + DoneCh chan<- struct{} + Plugins map[string]Plugin + Stderr io.Reader + Stdout io.Reader + func (s *RPCServer) Config() string + func (s *RPCServer) Init() error + func (s *RPCServer) Serve(lis net.Listener) + func (s *RPCServer) ServeConn(conn io.ReadWriteCloser) + type ReattachConfig struct + Addr net.Addr + Pid int + Protocol Protocol + 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)