Documentation
¶
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BytesToString(b []byte) string
- func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string)
- func DebugTemplatePath(tmpl string, intrf interface{})
- func Decrypt(key []byte, cryptoText string) string
- func Encrypt(key []byte, text string) string
- func FileServer() http.Handler
- func Form(r *http.Request, i interface{}) error
- func GenerateToken(url string, usertoken string) string
- func GetLine(fname string, match string) int
- func GetPl(tagstr string) string
- func GetSel(tagstr string) string
- func Handler(w http.ResponseWriter, r *http.Request)
- func Hash(input string) []byte
- func MakeHandler(fn func(http.ResponseWriter, *http.Request)) http.HandlerFunc
- func MustAsset(name string) []byte
- func NetAngularForm(args ...interface{}) string
- func NetBuild(args ...interface{}) string
- func NetForm(args ...interface{}) string
- func NetGenerateToken(args ...interface{}) string
- func NetHasBody(args ...interface{}) bool
- func NetIsIn(args ...interface{}) bool
- func NetTokenizeForm(args ...interface{}) (form fForm)
- func NetTokenizeFormAng(args ...interface{}) (form aForm)
- func NetaC(args ...interface{}) string
- func NetaO(args ...interface{}) string
- func Netadd(x, v float64) float64
- func NetatForm(args ...interface{}) string
- func NetatInput(args ...interface{}) string
- func NetbatForm(d aForm) string
- func NetbatInput(d afInput) string
- func NetbtForm(d fForm) string
- func NetbtInput(d fInput) string
- func NetcastaForm(args ...interface{}) *aForm
- func NetcastafInput(args ...interface{}) *afInput
- func NetcastfForm(args ...interface{}) *fForm
- func NetcastfInput(args ...interface{}) *fInput
- func NetcatForm(args ...interface{}) (d aForm)
- func NetcatInput(args ...interface{}) (d afInput)
- func NetctForm(args ...interface{}) (d fForm)
- func NetctInput(args ...interface{}) (d fInput)
- func Netdivided(x, v float64) float64
- func Netimportcss(s string) string
- func Netimportjs(s string) string
- func Netmultiply(x, v float64) float64
- func NetsessionDelete(s *sessions.Session) string
- func NetsessionGet(key string, s *sessions.Session) string
- func NetsessionGetInt(key string, s *sessions.Session) interface{}
- func NetsessionKey(key string, s *sessions.Session) bool
- func NetsessionRemove(key string, s *sessions.Session) string
- func NetsessionSet(key string, value string, s *sessions.Session) string
- func NetsessionSetInt(key string, value interface{}, s *sessions.Session) string
- func NetstructaForm() *aForm
- func NetstructafInput() *afInput
- func NetstructfForm() *fForm
- func NetstructfInput() *fInput
- func Netsubs(x, v float64) float64
- func NettForm(args ...interface{}) string
- func NettInput(args ...interface{}) string
- func Path(pathtoformat File) string
- func ReadyTemplate(body []byte) string
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SetField(obj interface{}, name string, value interface{}) error
- func SetKey(key string)
- func ToBson(data string) bson.M
- func UrlAtZ(url, base string) (isURL bool)
- func ValidateRequest(r *http.Request, usertoken string) bool
- type Date
- type Email
- type File
- type NoStruct
- type Page
- type Paragraph
- type Password
- type Radio
- type SampleForm
- type Select
- type SelectMult
Constants ¶
const (
MB = 1 << 20
)
select opts,placeholder,title
Variables ¶
var ( // string : Default input classes of // generared HTML input class attribute. InputClass string // string : Default submit button attribute class of // generated HTML forms. ButtonClass string // string : Secret form key FormKey = "a very very very very secret key" // int : Maximum upload size in Mb MaxSize = 10 //Mb )
Functions ¶
func Asset ¶ added in v0.2.1
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.2.1
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.2.1
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.2.1
func AssetNames() []string
AssetNames returns the names of the assets.
func BytesToString ¶ added in v0.2.1
func DebugTemplate ¶ added in v0.2.1
func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string)
func DebugTemplatePath ¶ added in v0.2.1
func DebugTemplatePath(tmpl string, intrf interface{})
func FileServer ¶ added in v0.2.1
func GenerateToken ¶
Returns form token. Each token is specific to the URL specified.
func MakeHandler ¶ added in v0.2.1
func MakeHandler(fn func(http.ResponseWriter, *http.Request)) http.HandlerFunc
Access you .gxml's end tags with this http.HandlerFunc. Use MakeHandler(http.HandlerFunc) to serve your web directory from memory.
func MustAsset ¶ added in v0.2.1
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NetAngularForm ¶ added in v0.2.1
func NetAngularForm(args ...interface{}) string
Return string of Angular form Argument 1 : Interface{} - Interface to build form with. Submit a variable with data to prepopulate form. Argument 2 : String - Target URL to submit form to. This is used to generate a token only valid for the specified target URL path. Argument 3 : String - JS Function to use with form's submit ng-click . Argument 4 : Call to action of form button. Argument 5 : String - variable name to be used as a local scope object to hold form data. Argument 5 : *sessions.Session Current user session. Must be passed to ensure secure communication.
func NetBuild ¶ added in v0.2.1
func NetBuild(args ...interface{}) string
Return HTML form Argument 1 : Interface{} - Interface to build form with. Submit a variable with data to prepopulate form. Argument 2 : String - Target URL to submit form to. Argument 3 : String - Method of form submission (GET,POST,PUT etc...). Argument 4 : String - Call to action of form button. Argument 5 : *sessions.Session Current user session. Must be passed to ensure secure communication.
func NetGenerateToken ¶ added in v0.2.1
func NetGenerateToken(args ...interface{}) string
Return string of form token. Argument 0 : String of URI your form is submitting to Argument 1 : *sessions.Session (github.com/gorilla/sessions)
func NetHasBody ¶ added in v0.2.1
func NetHasBody(args ...interface{}) bool
func NetTokenizeForm ¶ added in v0.2.1
func NetTokenizeForm(args ...interface{}) (form fForm)
func NetTokenizeFormAng ¶ added in v0.2.1
func NetTokenizeFormAng(args ...interface{}) (form aForm)
func NetatInput ¶ added in v0.2.1
func NetatInput(args ...interface{}) string
func NetbatForm ¶ added in v0.2.1
func NetbatForm(d aForm) string
func NetbatInput ¶ added in v0.2.1
func NetbatInput(d afInput) string
func NetbtInput ¶ added in v0.2.1
func NetbtInput(d fInput) string
func NetcastaForm ¶ added in v0.2.1
func NetcastaForm(args ...interface{}) *aForm
func NetcastafInput ¶ added in v0.2.1
func NetcastafInput(args ...interface{}) *afInput
func NetcastfForm ¶ added in v0.2.1
func NetcastfForm(args ...interface{}) *fForm
func NetcastfInput ¶ added in v0.2.1
func NetcastfInput(args ...interface{}) *fInput
func NetcatForm ¶ added in v0.2.1
func NetcatForm(args ...interface{}) (d aForm)
func NetcatInput ¶ added in v0.2.1
func NetcatInput(args ...interface{}) (d afInput)
func NetctInput ¶ added in v0.2.1
func NetctInput(args ...interface{}) (d fInput)
func Netdivided ¶ added in v0.2.1
func Netimportcss ¶ added in v0.2.1
func Netimportjs ¶ added in v0.2.1
func Netmultiply ¶ added in v0.2.1
func NetsessionDelete ¶ added in v0.2.1
func NetsessionGetInt ¶ added in v0.2.1
func NetsessionRemove ¶ added in v0.2.1
func NetsessionSet ¶ added in v0.2.1
func NetsessionSetInt ¶ added in v0.2.1
func NetstructaForm ¶ added in v0.2.1
func NetstructaForm() *aForm
func NetstructafInput ¶ added in v0.2.1
func NetstructafInput() *afInput
func NetstructfForm ¶ added in v0.2.1
func NetstructfForm() *fForm
func NetstructfInput ¶ added in v0.2.1
func NetstructfInput() *fInput
func ReadyTemplate ¶ added in v0.2.1
func RestoreAsset ¶ added in v0.2.1
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.2.1
RestoreAssets restores an asset under the given directory recursively
Types ¶
type File ¶
type File string
Handle file upload. Use func Path to get a string path relative to your filesystem.
type Radio ¶
type Radio Select
Display radio input. Tag properties : title : title of field. select : comma delimited choices of field.
type SampleForm ¶ added in v0.2.1
type SampleForm struct { TestField string `title:"Hi world!",valid:"unique",placeholder:"Testfield prompt"` Count int `placeholder:"Count"` Name Password `valid:"required",title:"Input title"` FieldTwo Radio `title:"Enter Email",valid:"email,unique,required",select:"blue,orange,red,green"` FieldF Select `placeholder:"Prompt?",valid:"email,unique,required",select:"blue,orange,red,green"` Created Date Text Paragraph `title:"Enter a description."` Photo File `file:"image/*"` Emal Email Terms bool `title:"Accept terms of use."` }
func NetcastSampleForm ¶ added in v0.2.1
func NetcastSampleForm(args ...interface{}) *SampleForm
func NetstructSampleForm ¶ added in v0.2.1
func NetstructSampleForm() *SampleForm
type Select ¶
type Select string
Display dropdown. Tag properties : title : title of field. placeholder : Prompt left of field. select : comma delimited choices of field.
type SelectMult ¶
type SelectMult Select
Display dropdown list with multiple selection support. Tag properties : title : title of field. placeholder : Prompt left of field. select : comma delimited choices of field.