config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InitConfig = Config{
		Plugins: Plugins{
			{
				Name:     "init",
				Manifest: "/kit/init",
			},
		},
	}

	BootstrapConfig = Config{
		Plugins: Plugins{
			{
				Name:     "plugin",
				Manifest: "/kit/plugin",
			},
		},
	}
)

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Type  string `json:"type"`
	Usage string `json:"usage"`
}

type Config

type Config struct {
	Manifest string  `json:"manifest,omitempty"`
	Plugins  Plugins `json:"plugins,omitempty"`
}

Config

func New

func New(path string) (*Config, error)

type Flag

type Flag struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Usage string `json:"usage"`
}

type Manifest

type Manifest struct {
	Revision string       `json:"revision"`
	Usage    string       `json:"usage"`
	Type     ManifestType `json:"type"`

	// Namespace only fields.
	Plugins Plugins `json:"plugins,omitempty"`

	// Command only fields.
	Platforms []Platform `json:"platforms,omitempty"`
	Args      []Arg      `json:"args,omitempty"`
	Flags     []Flag     `json:"flags,omitempty"`
}

type ManifestType

type ManifestType string
var (
	CommandManifest   ManifestType = "command"
	NamespaceManifest ManifestType = "namespace"
)

type Namespace

type Namespace struct {
	Plugins Plugins `json:"plugins,omitempty"`
}

type Platform

type Platform struct {
	OS           string `json:"os"`
	Architecture string `json:"architecture"`
	Digest       string `json:"digest"`
}

type Plugin

type Plugin struct {
	Name     string  `json:"name"`
	Usage    string  `json:"usage,omitempty"`
	Manifest string  `json:"manifest,omitempty"`
	Plugins  Plugins `json:"plugins,omitempty"`
}

func (Plugin) FindParent

func (p Plugin) FindParent(commandPath []string) Plugin

type Plugins

type Plugins []Plugin

func (Plugins) Merge

func (p Plugins) Merge(plugins Plugins) Plugins

func (Plugins) Print

func (p Plugins) Print()

func (Plugins) Sort

func (p Plugins) Sort()

Sort lexicographically sort plugins by name to produce a deterministic config.

Jump to

Keyboard shortcuts

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