config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: AGPL-3.0 Imports: 7 Imported by: 2 modules, 9 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

func WithGlobalConfig

func WithGlobalConfig(ctx context.Context, config *GlobalConfig) context.Context

WithGlobalConfig injects the IDE global configuration into context.

func WithPluginConfig

func WithPluginConfig(ctx context.Context, config *PluginConfig) context.Context

WithPluginConfig injects the IDE plugin configuration into context.

Types

type GlobalConfig

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

GlobalConfig holds the global configuration for the IDE.

func GlobalConfigFromContext

func GlobalConfigFromContext(ctx context.Context) *GlobalConfig

GlobalConfigFromContext returns the global configuration from the context.

func NewGlobalConfig

func NewGlobalConfig(config map[string]interface{}) *GlobalConfig

NewGlobalConfig creates a new global configuration.

func (*GlobalConfig) Get

func (c *GlobalConfig) Get(key string) interface{}

Get returns the value for the given key on the config.

type PluginAuthor

type PluginAuthor struct {
	Name  string `json:"name"  yaml:"name"`
	Email string `json:"email" yaml:"email,omitempty"`
	URL   string `json:"url"   yaml:"url,omitempty"`
}

type PluginComponentArea

type PluginComponentArea string
const (
	PluginComponentAreaEditor  PluginComponentArea = "EDITOR"
	PluginComponentAreaSidebar PluginComponentArea = "SIDEBAR"
)

type PluginComponents

type PluginComponents struct {
	Resource []PluginResourceComponent `json:"resource" yaml:"resource"`
}

type PluginConfig

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

PluginConfig holds the plugin configuration for the IDE.

func NewEmptyPluginConfig

func NewEmptyPluginConfig() *PluginConfig

NewEmptyPluginConfig creates a new empty plugin configuration.

func NewPluginConfig

func NewPluginConfig(config map[string]string) *PluginConfig

NewPluginConfig creates a new plugin configuration.

func PluginConfigFromContext

func PluginConfigFromContext(ctx context.Context) *PluginConfig

PluginConfigFromContext returns the plugin configuration from the context.

func (*PluginConfig) Get

func (c *PluginConfig) Get(key string) string

Get returns the value for the given key on the config.

type PluginMaintainer

type PluginMaintainer struct {
	Name  string `json:"name"  yaml:"name"`
	Email string `json:"email" yaml:"email"`
}

type PluginMeta

type PluginMeta struct {
	ID           string             `json:"id"           yaml:"id"`
	Version      string             `json:"version"      yaml:"version"`
	Name         string             `json:"name"         yaml:"name"`
	Icon         string             `json:"icon"         yaml:"icon"`
	IconURL      string             `json:"icon_url"     yaml:"icon_url,omitempty"`
	Description  string             `json:"description"  yaml:"description"`
	Repository   string             `json:"repository"   yaml:"repository"`
	Website      string             `json:"website"      yaml:"website"`
	Category     string             `json:"category"     yaml:"category,omitempty"`
	License      string             `json:"license"      yaml:"license,omitempty"`
	Markdown     string             `json:"-"            yaml:"-"`
	Author       *PluginAuthor      `json:"author,omitempty"      yaml:"author,omitempty"`
	Maintainers  []PluginMaintainer `json:"maintainers"  yaml:"maintainers"`
	Tags         []string           `json:"tags"         yaml:"tags"`
	Dependencies []string           `json:"dependencies" yaml:"dependencies"`
	Capabilities []string           `json:"capabilities" yaml:"capabilities"`
	Theme        PluginTheme        `json:"theme"        yaml:"theme"`
	Components   PluginComponents   `json:"components"   yaml:"components"`
}

PluginMeta is the plugin description file located at the root of a plugin.

func (*PluginMeta) GenerateHandshakeConfig

func (c *PluginMeta) GenerateHandshakeConfig() plugin.HandshakeConfig

GenerateHandshakeConfig generates a handshake config for the plugin given the plugin config.

func (*PluginMeta) HasBackendCapabilities

func (m *PluginMeta) HasBackendCapabilities() bool

HasBackendCapabilities checks if the plugin has UI capabilities. This is used to verify plugin loading and staring.

func (*PluginMeta) HasUICapabilities

func (m *PluginMeta) HasUICapabilities() bool

HasUICapabilities checks if the plugin has UI capabilities. This is used to verify plugin loading and staring.

func (*PluginMeta) Load

func (c *PluginMeta) Load(reader io.Reader) error

func (*PluginMeta) LoadMarkdown

func (c *PluginMeta) LoadMarkdown(path string) error

LoadMarkdown loads a plugin Markdown file from a given path (if it exists) into the plugin config.

type PluginMetaFormat

type PluginMetaFormat int
const (
	// PluginMetaFormatYAML is the YAML format for a plugin config.
	PluginMetaFormatYAML PluginMetaFormat = iota
	// PluginMetaFormatJSON is the JSON format for a plugin config.
	PluginMetaFormatJSON
)

type PluginResourceComponent

type PluginResourceComponent struct {
	Name           string              `json:"name"      yaml:"name"`
	Plugin         string              `json:"plugin"    yaml:"plugin"`
	Area           PluginComponentArea `json:"area"      yaml:"area"`
	Resources      []string            `json:"resources" yaml:"resources"`
	ExtensionPoint string              `json:"extension" yaml:"extension"`
}

type PluginTheme

type PluginTheme struct {
	Colors PluginThemeColors `json:"colors" yaml:"colors"`
}

type PluginThemeColors

type PluginThemeColors struct {
	Primary   string `json:"primary"   yaml:"primary"`
	Secondary string `json:"secondary" yaml:"secondary"`
	Tertiary  string `json:"tertiary"  yaml:"tertiary"`
}

Jump to

Keyboard shortcuts

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