open

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

This package exports the following C functions: - ss_instance_t* plugin_open(ss_plugin_t* s, char* params, ss_plugin_rc* rc) - void plugin_close(ss_plugin_t* s, ss_instance_t* h)

The exported plugin_open requires s to be a handle of cgo.Handle from this SDK. The value of the s handle must implement the sdk.LastError interface. plugin_open calls the function set with SetOnOpen, which returns a sdk.InstanceState interface. If the return value implements the sdk.Events interface, the function checks if an instance of sdk.EventWriters has already been set. If not, a default one is created on the fly and set with the SetEvents method.

The exported plugin_close requires h to be a handle of cgo.Handle from this SDK. If the value of the h handle implements the sdk.Closer interface, the function calls its Close method. If sdk.Events is implemented the function calls the Free method on the returned sdk.EventWriters. Finally, the function deletes the h cgo.Handle.

This function is part of the plugin_api interface as defined in plugin_api.h. In almost all cases, your plugin should import this module, unless your plugin exports those symbols by other means.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetOnOpen

func SetOnOpen(fn OnOpenFn)

SetOnInit sets an initialization callback to be called in plugin_open to create the plugin instance state. If never set, plugin_open will panic.

Types

type OnOpenFn

type OnOpenFn func(config string) (sdk.InstanceState, error)

OnOpenFn is a callback used in plugin_open.

Jump to

Keyboard shortcuts

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