adapter

package
v0.0.0-...-f325da8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdapterList *list.List = list.New()

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// Name of the adapter
	Name string
	// Version of the adapter
	Version string
	// Description of the adapter
	Description string
	// Start the adapter, will be run as a goroutine
	Start func()
	// Finalize the adapter, will be run after everything
	Finalize func()

	// Will automatically initialize when LoadAdapter is called
	ReceiveChannel message.MessageChannel
	SendChannel    message.MessageChannel
	ActionChannel  message.ActionChannel
	// contains filtered or unexported fields
}

Implement this to create an adapter

func (*Adapter) CallAction

func (a *Adapter) CallAction(action *message.ActionCall) (result any)

CallAction will call the adapter action and wait for the result, the result should be nil if error or ignored

Your adapter must push result to the ResultChannel!

Otherwise the plugin handler would stuck!

I warn you!

func (*Adapter) GetSerializer

func (a *Adapter) GetSerializer(typeName string) (serializer message.MessageSerializer)

func (*Adapter) RegisterSerializer

func (a *Adapter) RegisterSerializer(typeName string, serializer message.MessageSerializer)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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