ext

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ext the extension manager

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(typ ExtensionType) map[string]*Extension

Get returns all extensions of the specified type.

func Register

func Register(name string, typ ExtensionType, mod any)

Register a new extension with the given name and type. This function will panic if an unsupported extension type is provided, or if an extension of the same type and name is already registered.

Types

type Extension

type Extension struct {
	Name, Path, Version string
	Type                ExtensionType
	Module              any
}

Extension a generic container.

func GetAll

func GetAll() []*Extension

GetAll returns all extensions.

func GetName

func GetName(typ ExtensionType, name string) (ext *Extension, ok bool)

GetName returns extension of the specified type and name.

func (Extension) MarshalJSON

func (e Extension) MarshalJSON() ([]byte, error)

MarshalJSON encodes to JSON

func (Extension) String

func (e Extension) String() string

type ExtensionType

type ExtensionType uint

ExtensionType The type of extension

const (
	// JSExtension The modules.Module
	JSExtension ExtensionType = iota + 1
	// ParserExtension The parser.Parser.
	ParserExtension
)

func (ExtensionType) String

func (e ExtensionType) String() string

Jump to

Keyboard shortcuts

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