nativego

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package nativego loads trusted Go shared objects built with -buildmode=plugin. Host and guest must use matching Go toolchains, flags and shared dependencies. Loading runs package initializers. Images remain loaded for the host lifetime.

Index

Constants

View Source
const Symbol = "CTXPlugin"

Symbol is the required exported function name. The guest declares:

func CTXPlugin(context.Context) (plugin.Backend, error)

Each call must create an independent backend. Its Close releases resources; it cannot unload code. The factory context bounds startup, not guest lifetime.

Variables

This section is empty.

Functions

func Profile

func Profile() plugin.BackendProfile

func Supported

func Supported() bool

Types

type Backend

type Backend struct {
	*inprocess.Backend
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, path string) (*Backend, error)

Open loads an absolute, host-verified path and calls its exported factory. Use inside plugin.Options.Connect so verification precedes code execution. Go's loader and package initializers cannot be interrupted; factories and handlers must cooperate with context cancellation. Close must return promptly.

func (*Backend) Close

func (b *Backend) Close() error

Jump to

Keyboard shortcuts

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