plugin

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 2 Imported by: 9

README

plugin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(p Plugin)

func Update

func Update(plugName, objectName string, value interface{})

Types

type Config

type Config map[string]interface{}

type Context

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

func NewContext

func NewContext(injects map[string]interface{}) *Context

func (*Context) GetData

func (ctx *Context) GetData(k string) interface{}

func (*Context) GetInject

func (ctx *Context) GetInject(typ string) interface{}

func (*Context) SetData

func (ctx *Context) SetData(k string, v interface{})

func (*Context) SetInject

func (ctx *Context) SetInject(obj interface{})

type Plugin

type Plugin struct {
	Id           string
	Name         string
	Objects      map[string]interface{}
	ConfigSample string
	JsCode       string
	Init         func(map[string]interface{})
}

func Get

func Get(id string) *Plugin

func List

func List() []Plugin

Jump to

Keyboard shortcuts

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