config

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 2 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choice

type Choice struct {
	Group   string   `json:"group"`
	Option  []string `json:"option"` //["value","text"]
	Checked bool     `json:"checked"`
}

type Config

type Config struct {
	ID           string                 `json:"id"`
	Theme        string                 `json:"theme"`
	Template     string                 `json:"template"`
	Method       string                 `json:"method"`
	Action       string                 `json:"action"`
	Attributes   [][]string             `json:"attributes"`
	WithButtons  bool                   `json:"withButtons"`
	Buttons      []string               `json:"buttons"`
	BtnsTemplate string                 `json:"btnsTemplate"`
	Elements     []*Element             `json:"elements"`
	Languages    []*Language            `json:"languages"`
	Data         map[string]interface{} `json:"data,omitempty"`
}

func (*Config) Clone

func (c *Config) Clone() *Config

func (*Config) GetNames added in v1.6.4

func (c *Config) GetNames() []string

func (*Config) HasName

func (c *Config) HasName(name string) bool

type Element

type Element struct {
	ID         string                 `json:"id"`
	Type       string                 `json:"type"`
	Name       string                 `json:"name"`
	Label      string                 `json:"label"`
	LabelCols  int                    `json:"labelCols,omitempty"`
	FieldCols  int                    `json:"fieldCols,omitempty"`
	Value      string                 `json:"value"`
	HelpText   string                 `json:"helpText"`
	Template   string                 `json:"template"`
	Valid      string                 `json:"valid"`
	Attributes [][]string             `json:"attributes"`
	Choices    []*Choice              `json:"choices"`
	Elements   []*Element             `json:"elements"`
	Format     string                 `json:"format"`
	Languages  []*Language            `json:"languages,omitempty"`
	Data       map[string]interface{} `json:"data,omitempty"`
}

func (*Element) Clone

func (e *Element) Clone() *Element

type FormElement

type FormElement interface {
	Render() template.HTML
	Name() string
	OriginalName() string
	SetName(string)
	String() string
	SetData(key string, value interface{})
	Data() map[string]interface{}
	SetLang(lang string)
	Lang() string
	Clone() FormElement
}

FormElement interface defines a form object (usually a Field or a FieldSet) that can be rendered as a template.HTML object.

type Language

type Language struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	NameFormat string `json:"nameFormat"`
	// contains filtered or unexported fields
}

func NewLanguage

func NewLanguage(lang, label, namefmt string) *Language

func (*Language) AddField

func (l *Language) AddField(f ...FormElement)

func (*Language) Clone

func (l *Language) Clone() *Language

func (*Language) Field

func (l *Language) Field(name string) FormElement

func (*Language) Fields

func (l *Language) Fields() []FormElement

func (*Language) HasName

func (l *Language) HasName(name string) bool

func (*Language) Name

func (l *Language) Name(name string) string

Jump to

Keyboard shortcuts

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