config

package
v1.0.0-rc.68 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Schema: "https://github.com/pomdtr/sunbeam/releases/latest/download/config.schema.json",
	Root: []RootItem{
		{
			Title:   "Open Sunbeam Docs",
			Command: "sunbeam open https://pomdtr.github.io/sunbeam/book/introduction.html",
		},
		{
			Title:   "Edit Config",
			Command: "sunbeam edit --config",
		},
	},
}

Functions

func CommandParam

func CommandParam(command types.CommandSpec, name string) (types.Param, bool)

func ExtractParams

func ExtractParams(args []string, command types.CommandSpec) (map[string]any, error)

func Path

func Path() string

Types

type Config

type Config struct {
	Schema  string            `json:"$schema,omitempty"`
	Root    []RootItem        `json:"root,omitempty"`
	EnvFile string            `json:"envFile,omitempty"`
	Env     map[string]string `json:"-"`
}

func Load

func Load() (Config, error)

func (Config) RootItem

func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (types.ListItem, error)

type RootItem

type RootItem struct {
	Title   string `json:"title"`
	Command string `json:"command"`
}

Jump to

Keyboard shortcuts

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