plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonPlugin

type JsonPlugin struct {
}

func (*JsonPlugin) LoadSpec

func (j *JsonPlugin) LoadSpec(reader io.Reader) (SpecData, error)

func (*JsonPlugin) LoadSpecFile

func (j *JsonPlugin) LoadSpecFile(path string) (SpecData, error)

type OpenApiPlugin

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

func (*OpenApiPlugin) LoadSpec

func (o *OpenApiPlugin) LoadSpec(reader io.Reader) (SpecData, error)

func (*OpenApiPlugin) LoadSpecFile

func (o *OpenApiPlugin) LoadSpecFile(path string) (SpecData, error)

type Plugin

type Plugin interface {
	LoadSpecFile(path string) (SpecData, error)
	LoadSpec(reader io.Reader) (SpecData, error)
}

type Plugins

type Plugins interface {
	// GetPlugin provide Plugin by its name
	GetPlugin(pluginName string) Plugin
}

func NewPlugins

func NewPlugins() Plugins

type ProtobufPlugin

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

func NewProtobufPlugin

func NewProtobufPlugin() *ProtobufPlugin

func (*ProtobufPlugin) LoadSpec

func (p *ProtobufPlugin) LoadSpec(reader io.Reader) (SpecData, error)

func (*ProtobufPlugin) LoadSpecFile

func (p *ProtobufPlugin) LoadSpecFile(path string) (SpecData, error)

type SpecData

type SpecData any

SpecData represent the data of a specification. it can be any type, depending on the plugin. For example, OpenAPI plugin uses go-openapi/loads.Spec() to load a spec file.

The SpecData loaded by plugin is flattened to a map[string]interface{} via encoding/json/json.Marshal and json.Unmarshal for security. Thus, the field of SpecData that is not exported will not be exposed on rendering.

type YamlPlugin

type YamlPlugin struct {
}

func (*YamlPlugin) LoadSpec

func (y *YamlPlugin) LoadSpec(reader io.Reader) (SpecData, error)

func (*YamlPlugin) LoadSpecFile

func (y *YamlPlugin) LoadSpecFile(path string) (SpecData, error)

Jump to

Keyboard shortcuts

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