letsgoapp

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomSessionIDHandler interface{} = func(rep *global.Request) {
	txtUUID, err := uuid.NewV4()
	if golog.Error(err, true) {
		txtUUID = hash.SHA256([]byte(fmt.Sprint(time.Now().Unix())))
	}
	rep.SessionID = txtUUID
}

CustomSessionIDHandler is custom session id for all request

View Source
var FilterHandler interface{} = func(rep *global.Request) bool {
	return true
}
View Source
var LoadSessionHandler interface{} = func(rep *global.Request) {
	filename := fmt.Sprint(rep.SessionID, ".session")
	pathfile := fmt.Sprint(utility.GetAppDir(), global.DS, "sessions", global.DS, filename)
	rep.SESSION.FromFile(pathfile)
}

LoadSessionHandler is start session of all request

View Source
var SaveSessionHandler interface{} = func(rep *global.Request) {
	filename := fmt.Sprint(rep.SessionID, ".session")
	pathfile := fmt.Sprint(utility.GetAppDir(), global.DS, "sessions", global.DS, filename)
	rep.SESSION.ToFile(pathfile)
}

SaveSessionHandler is flush session of all request

Functions

func AddAPIFunc added in v0.0.8

func AddAPIFunc(pathAPI string, handler func(rep *global.Request) *jsons.JSONObject)

AddAPIFunc is add api function

func AddModuleFunc added in v0.0.9

func AddModuleFunc(pathTag string, handler func(rep *global.Request, params *jsons.JSONObject) string)

AddModuleFunc is add tag function

func AddSocketFunc added in v0.0.8

func AddSocketFunc(pathSocket string, handler func(rep *global.Request, ws *websocket.Conn))

AddSocketFunc is add socket function

func FlushSession

func FlushSession(rep *global.Request)

FlushSession is save session to file

func GetPathExt

func GetPathExt(path string) string

GetPathExt is get ext file of path

func Index added in v0.0.6

func Index(rep *global.Request)

Index is main page

func InitGet added in v0.2.0

func InitGet(rep *global.Request)

InitGet is load parameter for api path

func InitPost added in v0.2.0

func InitPost(rep *global.Request)

InitPost is load post from for api

func InitPostMultipart added in v0.2.0

func InitPostMultipart(rep *global.Request)

InitPostMultipart is load post multipart form for api

func InitSession

func InitSession(rep *global.Request) string

InitSession is load session first

func Listen

func Listen(port int)

Listen is begin work

func ModuleTagMap added in v0.0.9

func ModuleTagMap(rep *global.Request, buffer string) string

ModuleTagMap is change tag in file to system info

func ModuleTagRender added in v0.0.9

func ModuleTagRender(pathTag string, rep *global.Request, params *jsons.JSONObject) string

ModuleTagRender is add tag function

func NewRequest added in v0.0.6

func NewRequest(w http.ResponseWriter, r *http.Request) *global.Request

func Process

func Process(rep *global.Request)

Process is main processing

func SetMimeType

func SetMimeType(rep *global.Request)

SetMimeType is set header type for response

Types

This section is empty.

Jump to

Keyboard shortcuts

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