ipc

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCustomCfg added in v0.0.5

func FromCustomCfg(cfg Custom) (io.ReadWriteCloser, error)

FromCustomCfg is the counter part of ToCustomCfg(). Turns an file descriptor back into a connection object.

func Hijackify added in v0.0.6

func Hijackify(conn net.Conn, timeout time.Duration) (net.Conn, error)

Hijackify to be used in conjunction with HijackAcceptor. Tells the server to perform hijack operation on the connection which means the server will retrieve the underlying tcp connection and hand it over / no longer serves requests to it. -> we can use it as a long-running server-client connection and re-purpose it to run our IPC/yamux stack on top.

func NewClientIPC added in v0.0.6

func NewClientIPC(logger logging.Logger, sockConn io.ReadWriteCloser, handler http.Handler, onServerClosed func(error), option ...Option) (io.Closer, *http.Client, error)

func NewHijackAcceptor added in v0.0.6

func NewHijackAcceptor(logger logging.Logger, cb func(context.Context, io.ReadWriteCloser)) (string, http.Handler)

func NewServerIPC added in v0.0.6

func NewServerIPC(logger logging.Logger, sockConn io.ReadWriteCloser, handler http.Handler, onServerClosed func(error), option ...Option) (io.Closer, *http.Client, error)

Types

type CloseWriter added in v0.0.6

type CloseWriter interface {
	CloseWrite() error
}

type Custom added in v0.0.5

type Custom struct {
	Fd int `json:"fd"`
}

func FakeTestCustom added in v0.0.5

func FakeTestCustom(fd int) Custom

type FdWrapper added in v0.0.5

type FdWrapper struct {
	// contains filtered or unexported fields
}

func NewConnectionPair added in v0.0.5

func NewConnectionPair(cmd *exec.Cmd) (net.Conn, *FdWrapper, error)

func (*FdWrapper) Close added in v0.0.5

func (p *FdWrapper) Close() error

func (*FdWrapper) ToCustomCfg added in v0.0.5

func (p *FdWrapper) ToCustomCfg() Custom

type Option

type Option func(*cfg) *cfg

func WithShutdownTimeout

func WithShutdownTimeout(d time.Duration) Option

type PluginConfigFromEngine

type PluginConfigFromEngine struct {
	Name                string        `json:"name"`
	RegistrationTimeout time.Duration `json:"timeout"`
	Custom
}

func NewPluginConfigFromEngineEnv

func NewPluginConfigFromEngineEnv(in string) (*PluginConfigFromEngine, error)

func (*PluginConfigFromEngine) ToString

func (c *PluginConfigFromEngine) ToString() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL