web

package
v0.0.0-...-be2aa15 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

You can use the "packr clean" command to clean up this, and any other packr generated files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWebServer

func RunWebServer(config Configuration) error

Types

type ActionType

type ActionType string
const (
	Next   ActionType = "next"
	Back   ActionType = "back"
	Cancel ActionType = "cancel"
	Submit ActionType = "submit"
)

type Button

type Button struct {
	Label  string     `json:"label,omitempty"`
	Action ActionType `json:"action,omitempty"`
}

type Configuration

type Configuration interface {
	Host() string
	Port() int
	Schema() spec.Schema
	ApiVersion() string
	Kind() string
	Form() Form
	CallBack(yaml string) error
}

func NewConfiguration

func NewConfiguration(host string, port int, schema spec.Schema, apiVersion string, kind string, form Form, callback func(yaml string) error) (Configuration, error)

type Field

type Field struct {
	Label            string   `json:"label,omitempty"`
	Default          string   `json:"default,omitempty"`
	Description      string   `json:"description,omitempty"`
	Type             string   `json:"type,omitempty"`
	Required         bool     `json:"required,omitempty"`
	JSONPath         string   `json:"jsonPath,omitempty"`
	Min              *int     `json:"min,omitempty"`
	Max              *int     `json:"max,omitempty"`
	OriginalJSONPath string   `json:"originalJsonPath,omitempty"`
	Visible          bool     `json:"visible,omitempty"`
	Checked          bool     `json:"checked,omitempty"`
	DisplayWhen      string   `json:"displayWhen,omitempty"`
	Fields           []Field  `json:"fields,omitempty"`
	Options          []Option `json:"options,omitempty"`
}

type Form

type Form struct {
	Pages []Page `json:"pages,omitempty"`
}

type GoTemplate

type GoTemplate struct {
	ApiVersion string
	Kind       string
	Schema     string
	Form       string
}

type Option

type Option struct {
	Value string `json:"value,omitempty"`
	Label string `json:"label,omitempty"`
}

type Page

type Page struct {
	Label    string   `json:"label,omitempty"`
	Visible  bool     `json:"visible,omitempty"`
	Fields   []Field  `json:"fields,omitempty"`
	Buttons  []Button `json:"buttons,omitempty"`
	SubPages []Page   `json:"subPages,omitempty"`
}

Directories

Path Synopsis
You can use the "packr2 clean" command to clean up this, and any other packr generated files.
You can use the "packr2 clean" command to clean up this, and any other packr generated files.

Jump to

Keyboard shortcuts

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