golang

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildIPC

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

func NewChild

func NewChild(opts *Options, localApis ...any) (*ChildIPC, error)

func (ChildIPC) Call

func (ipc ChildIPC) Call(method string, params ...any) (Vals, error)

func (ChildIPC) ConvType

func (ipc ChildIPC) ConvType(needType reflect.Type, gotType reflect.Type, arg any) any

func (*ChildIPC) Start

func (c *ChildIPC) Start() error

func (*ChildIPC) Wait

func (c *ChildIPC) Wait() error

type IpcCommon

type IpcCommon interface {
	Call(method string, params ...any) (Vals, error)
	ConvType(needType, gotType reflect.Type, arg any) any
}

type Message

type Message struct {
	Type   MsgType `json:"type"`
	Id     int64   `json:"id"`
	Method string  `json:"method"`
	Args   Vals    `json:"args"`
	Result Vals    `json:"result"`
	Error  string  `json:"error"`
}

type MsgType

type MsgType int
const (
	MsgCall     MsgType = 1
	MsgResponse MsgType = 2
)

type Options

type Options struct {
	DebugMessages bool
}

type ParentIPC

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

func NewParent

func NewParent(cmd *exec.Cmd, opts *Options, localApis ...any) (*ParentIPC, error)

func NewParentWithContext

func NewParentWithContext(ctx context.Context, cmd *exec.Cmd, opts *Options, localApis ...any) (*ParentIPC, error)

func (ParentIPC) Call

func (ipc ParentIPC) Call(method string, params ...any) (Vals, error)

func (ParentIPC) ConvType

func (ipc ParentIPC) ConvType(needType reflect.Type, gotType reflect.Type, arg any) any

func (*ParentIPC) Start

func (p *ParentIPC) Start() error

func (*ParentIPC) Stop

func (p *ParentIPC) Stop() error

func (*ParentIPC) Wait

func (p *ParentIPC) Wait(timeout ...time.Duration) (retErr error)

type Vals

type Vals []any

Source Files

  • child.go
  • common.go
  • parent.go
  • protocol.go
  • serialize.go
  • util.go

Jump to

Keyboard shortcuts

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