types

package
v0.0.0-...-e9d226e Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildScript

type BuildScript struct {
	// Build directory (sm-build/plugins/<plugin name>)
	BuildDir string
	// Root build directory (sm-build)
	RootBuildDir string
}

type Config

type Config struct {
	Plugins map[string]map[string]any `yaml:"plugins"`
	Port    int                       `yaml:"port"`
}

type FrontendConfig

type FrontendConfig struct {
	FrontendProvider Provider // frontend provider

	ComponentProvider Provider // component provider
	CorelibProvider   Provider // corelib provider

	// an extra files to load from the corelib provider, key is the path to the file/folder in the src, value is the file/folder to the file in the out
	//
	// Note: the dst is relative to the build folder. If $lib/ is prefix, the dst is relative to the lib folder
	ExtraFiles map[string]string
}

type FrontendServer

type FrontendServer struct {
	Host                string
	ExtraHeadersToAllow []string
	Dir                 string   // The directory to serve
	DirAbsolute         bool     // If true, the dir is absolute, otherwise, it's relative to the root of the project
	RunCommand          string   // The command to run to start the server
	ExtraEnv            []string // Extra environment variables to pass to the server, format KEY=value
}

type Plugin

type Plugin struct {
	ID          string // Note that the id of the plugin should never be changed as it determines API endpoints
	Init        func(c *PluginConfig) error
	BuildScript func(b *BuildScript) error
	Preload     func(c *PluginConfig) error // Function to call on preload. Note that only Name and RawMux are set
	Frontend    Provider
}

type PluginConfig

type PluginConfig struct {
	Mux    chi.Router
	RawMux *chi.Mux
	Name   string
}

type Provider

type Provider struct {
	Provider  string // use @core to use the libs from sysmanage itself, otherwise, specify a local directory
	Overrides []string
}

type ServerMeta

type ServerMeta struct {
	ConfigVersion  int
	Port           int
	FrontendServer *FrontendServer // Leave blank to use static frontend
	Plugins        []Plugin        // List of plugins to load
	Frontend       FrontendConfig
}

Jump to

Keyboard shortcuts

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