meta

package
v0.10.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginModeEnvVar = "OPNI_PLUGIN_MODE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedPluginMeta added in v0.8.0

type ExtendedPluginMeta struct {
	ModeList ModeList
}

type ModeList added in v0.8.0

type ModeList struct {
	Modes []PluginMode `json:"modes"`
}

func QueryPluginModes added in v0.8.0

func QueryPluginModes(pluginFilename string) (ModeList, error)

type ModeSet added in v0.8.0

type ModeSet map[PluginMode]SchemeFunc

func (ModeSet) MarshalJSON added in v0.8.0

func (m ModeSet) MarshalJSON() ([]byte, error)

type PluginMeta

type PluginMeta struct {
	BinaryPath string
	GoVersion  string
	Module     string

	// Extended metadata not populated from build info.
	ExtendedMetadata *ExtendedPluginMeta
}

func ReadFile added in v0.8.0

func ReadFile(f file) (PluginMeta, error)

Reads relevant metadata from an opened file. Does not change the i/o offset of the file.

func ReadMetadata

func ReadMetadata() PluginMeta

func ReadPath added in v0.8.0

func ReadPath(path string) (PluginMeta, error)

Reads relevant metadata from the binary at the given path.

func (PluginMeta) Filename added in v0.8.0

func (pm PluginMeta) Filename() string

type PluginMode added in v0.6.0

type PluginMode string
const (
	ModeGateway   PluginMode = "gateway"
	ModeAgent     PluginMode = "agent"
	ModeListModes PluginMode = "__list_modes__"
)

func (PluginMode) IsValid added in v0.8.0

func (m PluginMode) IsValid() bool

type Scheme

type Scheme interface {
	Add(string, plugin.Plugin)
	PluginMap() map[string]plugin.Plugin
	Mode() PluginMode
}

func NewScheme

func NewScheme(opts ...SchemeOption) Scheme

type SchemeFunc added in v0.8.0

type SchemeFunc = func(context.Context) Scheme

type SchemeOption added in v0.6.0

type SchemeOption func(*SchemeOptions)

func WithMode added in v0.6.0

func WithMode(mode PluginMode) SchemeOption

type SchemeOptions added in v0.6.0

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

Jump to

Keyboard shortcuts

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