forms

package
v0.0.0-...-bb4fd4e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidId = 0xffffffff
)

Variables

This section is empty.

Functions

func Documents

func Documents() docs.Docs

func GetRequestInt

func GetRequestInt(r *http.Request, key string) (sel int)

func GetRequestString

func GetRequestString(r *http.Request, key string) (sel string)

func GetRequestUint

func GetRequestUint(r *http.Request, key string) (sel uint)

func Mask

func Mask(m interface{}, mask uint) (b bool)

func Request

func Request(u string) (data []byte, err error)

func UnMask

func UnMask(m interface{}, mask uint, isTrue bool) (err error)

func UnMasks

func UnMasks(m interface{}, mask uint, s string) (err error)

func UseDocuments

func UseDocuments(init docs.Docs)

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteResponse

func WriteResponse(w http.ResponseWriter, b []byte)

Types

type Entries

type Entries []*Entry

type Entry

type Entry struct {
	ID    string  `json:"entryId"`
	Name  string  `json:"name"`
	Code  string  `json:"code"`
	Label string  `json:"label"`
	URL   string  `json:"url"`
	Type  string  `json:"type"`
	Min   float32 `json:"min"`
	Max   float32 `json:"max"`
	Step  float32 `json:"step"`
	Item  uint    `json:"item"`
	Val   func(interface{}) interface{}
	Scan  func(string, interface{}) error
}

Entry -

func (*Entry) Checked

func (ent *Entry) Checked(v interface{}) (b bool)

func (*Entry) Documents

func (ent *Entry) Documents() docs.Docs

func (*Entry) FindDoc

func (ent *Entry) FindDoc(code string) *docs.Doc

func (*Entry) FormatInput

func (ent *Entry) FormatInput(value interface{}, first *Entry) (f *InputFormat)

func (*Entry) InBounds

func (ent *Entry) InBounds(s string) bool

func (*Entry) InfoURL

func (ent *Entry) InfoURL(base string) (s string)

func (*Entry) ResponseList

func (ent *Entry) ResponseList(v interface{}) []string

func (*Entry) ScanInput

func (ent *Entry) ScanInput(s string, value interface{}) (err error)

func (*Entry) Value

func (ent *Entry) Value(v interface{}) (r interface{})

type Form

type Form struct {
	ID      WebId
	Value   interface{}
	Entries Entries
	BaseUrl string
}

func (*Form) FindDoc

func (form *Form) FindDoc(code string) *docs.Doc

func (*Form) GetUpdated

func (form *Form) GetUpdated() (updated []*Updated)

func (*Form) Identify

func (form *Form) Identify(ctlid, view, icon string,
	results []string) (ident *Identifier)

func (*Form) ToJSON

func (form *Form) ToJSON() (b []byte)

func (*Form) Update

func (form *Form) Update(vals map[string][]string) (err error)

type Forms

type Forms map[WebId]*Form

type Identifier

type Identifier struct {
	CtlID   string
	View    string
	FormID  string
	Form    *Form
	Icon    string
	Results []string
}

type InputFormat

type InputFormat struct {
	Entry      *Entry
	Name       string
	Class      string
	Value      string
	HasChecked bool
	HasRange   bool
	HasStep    bool
	ReadOnly   bool
}

type Updated

type Updated struct {
	ID    string      `json:"id"`
	Value interface{} `json:"value"`
}

type WebId

type WebId uint32

func ToWebId

func ToWebId(s string) (id WebId)

func (WebId) Index

func (id WebId) Index(i int) string

func (WebId) String

func (id WebId) String() string

func (WebId) Valid

func (id WebId) Valid() bool

type WebIds

type WebIds []WebId

func (WebIds) Len

func (ids WebIds) Len() int

func (WebIds) Less

func (ids WebIds) Less(i, j int) bool

func (WebIds) Swap

func (ids WebIds) Swap(i, j int)

Jump to

Keyboard shortcuts

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