helper

package module
v0.0.0-...-25c73a1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2015 License: GPL-2.0 Imports: 12 Imported by: 0

README

helper

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	/**
	  gobbs template -> timestamp
	  timestamp is get from db when user add or update the template in db.
	*/
	CacheMapGobbsDbTemplates map[string]string
)
View Source
var ERROR_CLASS = "hasError"
View Source
var (
	// The functions available for use in the templates.
	TemplateFuncs = map[string]interface{}{
		"label": strings.Title,
		"eq":    Equal,
		"set": func(renderArgs map[string]interface{}, key string, value interface{}) template.HTML {
			renderArgs[key] = value
			return template.HTML("")
		},
		"append": func(renderArgs map[string]interface{}, key string, value interface{}) template.HTML {
			if renderArgs[key] == nil {
				renderArgs[key] = []interface{}{value}
			} else {
				renderArgs[key] = append(renderArgs[key].([]interface{}), value)
			}
			return template.HTML("")
		},

		"nl2br": func(text string) template.HTML {
			return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "<br>", -1))
		},

		"raw": func(text string) template.HTML {
			return template.HTML(text)
		},
	}
)

Functions

func DynamicRender

func DynamicRender(template_name, template_value string) (str string, is_ok bool, err_str string)

func Equal

func Equal(a, b interface{}) bool

Equal is a helper for comparing value equality, following these rules:

  • Values with equivalent types are compared with reflect.DeepEqual
  • int, uint, and float values are compared without regard to the type width. for example, Equal(int32(5), int64(5)) == true
  • strings and byte slices are converted to strings before comparison.
  • else, return false.

func GenerateDynamicTemplateName

func GenerateDynamicTemplateName(tmplt_name, time_stamp, web_ui_theme_dir string) (template_name string)

func GetAdminsTemplateFile

func GetAdminsTemplateFile(ori_tmplt_file string) string

func GetTemplateTimestamp

func GetTemplateTimestamp(template_file_path string) (timestamp string)

func ReadMe

func ReadMe()

func SetTemplateTimestamp

func SetTemplateTimestamp(template_file_path, timestamp string)

func Test2

func Test2()

Types

type CurdResult

type CurdResult struct {
	Error   error
	IsOk    bool
	Message string
}

type DTime

type DTime struct {
	Layout string
	Zone   string
}

func NewTime

func NewTime() *DTime

func (*DTime) GetStrToTime

func (t *DTime) GetStrToTime(s string) int64

func (*DTime) GetTimeToStr

func (t *DTime) GetTimeToStr(tm int64, fm ...string) string

func (*DTime) StrToUnix

func (t *DTime) StrToUnix(s string) int64

func (*DTime) UnixToStr

func (t *DTime) UnixToStr(n int64, layouts ...string) string

type DomoloRevelApp

type DomoloRevelApp struct {
	*revel.Controller
}

func (DomoloRevelApp) GetDb

func (c DomoloRevelApp) GetDb() *sql.DB

func (DomoloRevelApp) GetDbm

func (c DomoloRevelApp) GetDbm() *gorp.DbMap

type HtmlDocument

type HtmlDocument struct {
}

type LinkTag

type LinkTag struct {
	Text string
	Href string
}

type LinkTags

type LinkTags []LinkTag
func DGetAllLinks(html_code string) LinkTags

type ParentApp

type ParentApp interface {
	GetDb() *sql.DB
	GetDbm() *gorp.DbMap
}

type UniformField

type UniformField struct {
	EnName               string
	CnName               string
	HiddenEnFieldStr     string
	HiddenCnFieldStr     string
	DefaultInputFieldStr string
}

type UrlToActionSM

type UrlToActionSM struct {
	/**
	UrlType
	// 0 common, 1 fixed , 2 prefix fixed and only myid
		3: node detail page url

	// if UrlType > 0 then NotUseActionTemplate is true
	//NotUseActionTemplate bool


	BizType:
		0, default
		1, node

	*/
	TmpltKey      string
	Action        string
	Myid          string
	RenderMapPath string
	Role          string
	ModuleDirPath string
	ErrorMsg      string
	IsDbTmplt     bool
	DbTName       string
	DbTTimestamp  string
	Prefix        string
	UrlType       int
	BizType       int
	RequestURI    string
	FilePath      string
}

type ViewResult

type ViewResult struct {
	/**
	  TransferObject
	*/
	IsOk      bool
	Error     error
	Type      string      // ->  array/ pointer /  pointer to array / map  / etc
	IMObjType string      // -> one stuct , or map  or   array  or pointer to obj , or obj array etc.
	IMObj     interface{} //->  the quesiton is : how we could convert IObj  to the real struct of where it come from?

}

Jump to

Keyboard shortcuts

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