pluginmanager

package module
v0.0.0-...-ea854e6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 2 Imported by: 0

README

Hyperscale Plugin Manager Last release Documentation

Go Report Card

Branch Status Coverage
master Build Status Coveralls

The Hyperscale Plugin Manager library provides a simple golang plugin manager

Example

package main

import (
    "github.com/hyperscale-stack/pluginmanager"
)

func main() {

}

License

Hyperscale pluginmanager is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin[T any] struct {
	Name     string
	Instance T
}

func (*Plugin[T]) ID

func (p *Plugin[T]) ID() string

func (*Plugin[T]) Load

func (p *Plugin[T]) Load() T

type PluginManager

type PluginManager[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any]() *PluginManager[T]

func (*PluginManager[T]) Get

func (pm *PluginManager[T]) Get(name string) (p T, err error)

Get returns a plugin by name.

func (*PluginManager[T]) Register

func (pm *PluginManager[T]) Register(plugin *Plugin[T]) error

Register registers a plugin.

func (*PluginManager[T]) RegisterFromFile

func (pm *PluginManager[T]) RegisterFromFile(path string) error

RegisterFromFile registers a plugin from a file.

Directories

Path Synopsis
plugin

Jump to

Keyboard shortcuts

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