adapter

package
v0.5.0-rc01 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAdapterPlugin

func RegisterAdapterPlugin(p AdapterPlugin)

RegisterAdapterPlugin registers adapter plugin

Types

type Adapter

type Adapter interface {
	// Start start adapter lifetime
	Start()
	// Stop stop adapter lifetime
	Stop()
	// Apply init
	Apply() error
	// Config get config for Adapter
	Config() interface{}
}

Adapter adapter interface

type AdapterPlugin

type AdapterPlugin interface {
	// Kind returns the unique kind name to represent itself.
	Kind() string

	// CreateAdapter return the Adapter callback
	CreateAdapter(ad *model.Adapter) (Adapter, error)
}

AdapterPlugin plugin for adapter

func GetAdapterPlugin

func GetAdapterPlugin(kind string) (AdapterPlugin, error)

GetAdapterPlugin get plugin by kind

Jump to

Keyboard shortcuts

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